comp.lang.ada
 help / color / mirror / Atom feed
* Arrays Declarations
@ 1986-02-18 22:27 Steven Holtsberg
  0 siblings, 0 replies; only message in thread
From: Steven Holtsberg @ 1986-02-18 22:27 UTC (permalink / raw)


I have read the paragraph on index constraints (page 3-29,
second from bottom) over and over, and I still do not know
what they are talking about.

It says:

   If an index constraint follows a type mark in a subtype
   indication, then the type or subtype denoted by the
   type mark _must not already impose an index constraint_.
   The type mark must denote either an unconstrained array
   type or an access type whose designated type is such an
   array type.

As I understand it, an index constraint (page 3-27) is a list of ranges
or subtype indications.  So, if it follows a type mark, we have
something like:

    INTEGER INTEGER range 0 .. 100

    or 

    INTEGER range 0 .. 100

The first makes no sense, so I assume they mean the second, which
is an index constraint itself (as well as one that follows a type mark).

On the same page, there is an example,

type T is array(POSITIVE range MIN .. MAX) of COMPONENT;

It seems that the type mark in question is POSITIVE and
the index constraint is
range MIN .. MAX.
So, this means that POSITIVE must not already impose an index
constraint.  But this makes no sense: although predefined
(see page 3-32), POSITIVE has the constraint 1 .. INTEGER'LAST.
The only thing I can infer is that the type of subtype denoted
by the type mark cannot impose a user-defined index constraint.
I am not sure of this- is there any agreement on the net?

However, the next sentence really confuses me:

   The type mark must denote either an unconstrained array type
   or an access type whose designated type is such an array type.

POSITIVE certainly does not satisfy this condition.

Does anyone know what they are talking about?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1986-02-18 22:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1986-02-18 22:27 Arrays Declarations Steven Holtsberg

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