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: "Matthew Heaney" Subject: Re: array size Date: 1999/12/11 Message-ID: <38528a48_2@news1.prserv.net>#1/1 X-Deja-AN: 559421287 Content-transfer-encoding: 7bit References: <101219991605504828%hopperj@macconnect.com> <3851d15b_1@news1.prserv.net> <82to3s$ng7$1@nnrp1.deja.com> Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 11 Dec 1999 17:30:48 GMT, 129.37.62.58 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 1999-12-11T00:00:00+00:00 List-Id: In article , Robert A Duff 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.