From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: array size
Date: 1999/12/11
Date: 1999-12-11T00:00:00+00:00 [thread overview]
Message-ID: <38528a48_2@news1.prserv.net> (raw)
In-Reply-To: wccln71to2l.fsf@world.std.com
In article <wccln71to2l.fsf@world.std.com> , Robert A Duff
<bobduff@world.std.com> wrote:
>> > 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;
>
> 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.
Yes. That's what I showed in the latter part of the example:
> for Day_Array_Type'Size use 7 * Preset_Array_Type_Size;
--
Help keep evolution in the science classroom and religion out: become a
member of the National Center for Science Education.
<http://www.natcenscied.org/>
next prev 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 ` Robert A Duff
1999-12-11 0:00 ` Matthew Heaney [this message]
1999-12-11 0:00 ` Matthew Heaney
1999-12-13 0:00 ` Robert A Duff
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