comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: array size
Date: 1999/12/11
Date: 1999-12-11T00:00:00+00:00	[thread overview]
Message-ID: <wccln71to2l.fsf@world.std.com> (raw)
In-Reply-To: 82to3s$ng7$1@nnrp1.deja.com

Robert Dewar <robert_dewar@my-deja.com> writes:

> In article <3851d15b_1@news1.prserv.net>,
>   "Matthew Heaney" <matthew_heaney@acm.org> wrote:
> > >   for Preset_Array_Type'Size use 6 * Frequency_Type'Size;
> >
> > Always do this for composite types:
> >
> >   Preset_Array_Type_Size : constant := 6 *
> Frequency_Type'Size;
> >   for Preset_Array_Type'Size use Preset_Array_Type_Size;
> 
> 
> This is incomprehensible advice, these are obviously equivalent.
> Both will of course be illegal if Frequency_Type'Size is not
> static ... Matthew what are you trying to say here?

I stared at that one for a long time before I realized -- I think what
he's trying to accomplish is that you can elsewhere refer to the size of
Preset_Array_Type in a static expression (perhaps in some other rep
clause).  "Preset_Array_Type'Size" won't work, because it's not static.
You obviously don't want to write "6 * Frequency_Type'Size" more than
once in the program.  He's come up with a coding convention that ensures
you can always say "Preset_Array_Type_Size" to get the size of an array
as a static expression.

- Bob




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

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-10  0:00 array size James E. Hopper
1999-12-10  0:00 ` Matthew Heaney
1999-12-11  0:00   ` James E. Hopper
1999-12-11  0:00   ` Robert Dewar
1999-12-11  0:00     ` Matthew Heaney
1999-12-13  0:00       ` Robert A Duff
1999-12-11  0:00     ` Robert A Duff [this message]
1999-12-11  0:00       ` Matthew Heaney
1999-12-11  0:00     ` James E. Hopper
1999-12-12  0:00       ` Matthew Heaney
1999-12-11  0:00 ` DuckE
1999-12-11  0:00   ` James E. Hopper
1999-12-11  0:00     ` DuckE
1999-12-12  0:00       ` James E. Hopper
1999-12-12  0:00       ` Matthew Heaney
replies disabled

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