comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: *\\~record depth~//*
Date: 1999/11/16
Date: 1999-11-16T00:00:00+00:00	[thread overview]
Message-ID: <80s28q$71j$1@nnrp1.deja.com> (raw)
In-Reply-To: 38312BD8.3D753AE1@interact.net.au

In article <38312BD8.3D753AE1@interact.net.au>,
  G <Dizzy@interact.net.au> wrote:
> I didn't know either of those 'shortcuts'.
> Thanks to you both.  I am self-educating.
>
> -Graeme

Just to follow up further on my comment that

  array (subtype-mark) of ...

is not a shortcut.

The fundamental idea of an array declaration is that you need
to specify the subtype of the subscript(s). The above is
the basic way of doing things. It is the .. notation that
is a shortcut

  array (x .. y) of ...

is a shortcut (and sometimes a confusing one) for

  subtype subscr is ... range X .. Y;
  array (subscr) of ...

What is confusing here is the type to put in for ... in the
subtype declaration. The rule is a bit peculiar:

If the types of x and y are other than universal integer, then
the type for ... is taken from the types of x and y.

If universal integers are used, then quite arbitrarily (and
in the view of many quite unwisely since it introduces junk
implementation dependencies in an implicit manner), the type
chosen is Standard.Integer.

Best idea always make the type of the subscript explicit in
the declaration. Either declare the subscript type, or use

  array (... range x .. y) of ...


Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~1999-11-16  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-09  0:00 *\\~record depth~//* G
1999-11-08  0:00 ` Nick Roberts
1999-11-09  0:00   ` Robert Dewar
1999-11-09  0:00     ` David C. Hoos, Sr.
1999-11-09  0:00       ` Robert Dewar
1999-11-09  0:00 ` oops - same with neater formatting G
1999-11-15  0:00 ` *\\~record depth~//* Mario Amado Alves
1999-11-15  0:00   ` Matthew Heaney
1999-11-16  0:00     ` G
1999-11-16  0:00       ` Robert Dewar
1999-11-16  0:00       ` Robert Dewar [this message]
1999-11-16  0:00         ` Robert A Duff
1999-11-16  0:00       ` Robert Dewar
replies disabled

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