From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,72340e997bfd5289 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: array size Date: 1999/12/11 Message-ID: #1/1 X-Deja-AN: 559413912 Sender: bobduff@world.std.com (Robert A Duff) References: <101219991605504828%hopperj@macconnect.com> <3851d15b_1@news1.prserv.net> <82to3s$ng7$1@nnrp1.deja.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1999-12-11T00:00:00+00:00 List-Id: Robert Dewar writes: > In article <3851d15b_1@news1.prserv.net>, > "Matthew Heaney" 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