comp.lang.ada
 help / color / mirror / Atom feed
* ada.sequential_io problem
@ 1995-03-14  6:44 Tore Joergensen
  1995-03-14 14:01 ` Robert A Duff
  1995-03-15 11:00 ` Pascal OBRY
  0 siblings, 2 replies; 3+ messages in thread
From: Tore Joergensen @ 1995-03-14  6:44 UTC (permalink / raw)


What is wrong???

I tried to define:
  package bio is new ada.sequential_io(unsigned_8);

Unsigned_8 is defined in the package interfaces as:
  type unsigned_8 is mod 2 ** 8;
  for unsigned_8'size use 8;

When I try to compile (gnat 2.03 for OS/2), I get:
  f:\EMX\GNATLIB\a-sequio.adb:33:59: actual for "Element_Type"
    must be a definite subtype

LRM 3.5.4 (10):
"... A modular_type_definition also defines a constrained first subtype
of the type with a range that is the same as the base range of the type."

LRM 3.3 (23):
"... A subtype is an indefinite subtype if it is an unconstrained array
subtype, or if it has unknown discriminants or unconstrained discriminants
without defaults (see 3.7); otherwise the subtype is a definite subtype
(all elementary subtypes are definite subtypes). ..."

I can't figure out what is wrong with my package-definition. I even tried
to make it with integer (the rationale (part2.II.11) says that integer is
a definite type)
   package bio is new ada.sequential_io(integer);
but I got the same error. Can the problem be that the sequential_io package
uses storage_io where the Element_type is defined as private, while the
sequential_io defines Element_type(<>) as private? If this is the problem,
doesn't that mean that sequential_io will never work?

Any help will be appreciated!

--
______________________________________________________________________
Tore B. Joergensen,    |    e-mail:     tore@lis.pitt.edu
a norwegian student    |    snail-mail: 2201 Pittockstr.
a long way from home.  |                Pittsburgh, 15217 PA
                       |    web:        http://www.pitt.edu/~tojst1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ada.sequential_io problem
  1995-03-14  6:44 ada.sequential_io problem Tore Joergensen
@ 1995-03-14 14:01 ` Robert A Duff
  1995-03-15 11:00 ` Pascal OBRY
  1 sibling, 0 replies; 3+ messages in thread
From: Robert A Duff @ 1995-03-14 14:01 UTC (permalink / raw)


In article <3k3e12$2op@toads.pgh.pa.us>,
Tore Joergensen <tore@lis.pitt.edu> wrote:
>What is wrong???

Sounds like a compiler bug.

First of all, Sequential_IO allows both definite and indefinite subtypes
-- that's what the (<>) means.

Furthermore, all elementary subtypes, including modular ones, are
definite.  It's only composite subtypes that can be indefinite.

>I tried to define:
>  package bio is new ada.sequential_io(unsigned_8);
>
>Unsigned_8 is defined in the package interfaces as:
>  type unsigned_8 is mod 2 ** 8;
>  for unsigned_8'size use 8;
>
>When I try to compile (gnat 2.03 for OS/2), I get:
>  f:\EMX\GNATLIB\a-sequio.adb:33:59: actual for "Element_Type"
>    must be a definite subtype

- Bob



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ada.sequential_io problem
  1995-03-14  6:44 ada.sequential_io problem Tore Joergensen
  1995-03-14 14:01 ` Robert A Duff
@ 1995-03-15 11:00 ` Pascal OBRY
  1 sibling, 0 replies; 3+ messages in thread
From: Pascal OBRY @ 1995-03-15 11:00 UTC (permalink / raw)



It's a know bug.

The README at cs.nyu.edu say :

-------------------------------------------------
Sequential_IO Note: Feb 16, 1995 :15:50 EST
 
   In GNAT 2.03 all instantiations of sequential_io will get the message:
   a-sequio.adb:33:59: actual for "Element_Type" must be a definite subtype
 
   The workaround is simple. Modify the type declaration of Element_Type on
   line 22 of adainclude/a-sequio.ads and remove the (<>). This should solve
   the problem.
 
   Note : This is a glitch in our current implementation of Sequential_IO,
   which will be fixed ASAP. In the meantime, the proposed workaround
   restricts one to instantiate Sequential_IO only with constrained types.
-------------------------------------------------
 
--

--|---------------------------------------------------------------
--| Pascal OBRY			e-mail: pascal.obry@der.edf.fr   |
--| EDF-DER-IPN-SID-ISI					         |
--| Bureau G1-010			voice: +33-1-47.65.50.91 |
--| 1 Av General de Gaulle				         |
--| 92141 Clamart CEDEX		     			         |
--| FRANCE			     			         |
--|---------------------------------------------------------------



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1995-03-15 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-03-14  6:44 ada.sequential_io problem Tore Joergensen
1995-03-14 14:01 ` Robert A Duff
1995-03-15 11:00 ` Pascal OBRY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox