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,d9fa52ca55dcef0e X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: Packed array size question.... Date: 1997/03/13 Message-ID: #1/1 X-Deja-AN: 225144297 References: <01bc2b36$b64477a0$f5093e9f@lsm8-pc.linkabit.titan.com> Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-03-13T00:00:00+00:00 List-Id: In article , dewar@merv.cs.nyu.edu (Robert Dewar) wrote: >Marc says >none of them work! help! I am going out of my mind trying to figure this >out. > >A good idea in such a case is to check your assumptions. You are assuming >that Size yields the size in storage units, but let's read the RM: > >40 X'Size > Denotes the size in bits of the representation of the object. > The value of this attribute is of the type universal_integer. > > >Ah ha! bits!!! >:-) Forgetting that 'Size returns size in bits is an error that Ada programmers often make. You have to admit that the attribute X'Size_In_Storage_Elements would make a lot of sense. In practice, knowing the number of storage elements occupied by an object is much more useful than knowing the number of bits. Surprisingly, this attribute was not included in Ada 95! Matt -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271