comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@ni.net (Matthew Heaney)
Subject: Re: Packed array size question....
Date: 1997/03/13
Date: 1997-03-13T00:00:00+00:00	[thread overview]
Message-ID: <mheaney-ya023680001303970016240001@news.ni.net> (raw)
In-Reply-To: dewar.857784634@merv


In article <dewar.857784634@merv>, 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
<mailto:matthew_heaney@acm.org>
(818) 985-1271




  reply	other threads:[~1997-03-13  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-07  0:00 Packed array size question Marc Bejerano
1997-03-07  0:00 ` Robert Dewar
1997-03-13  0:00   ` Matthew Heaney [this message]
     [not found]     ` <01bc300c$247f6200$0e096dce@my-pc.neosoft.com>
1997-03-15  0:00       ` Robert Dewar
1997-03-16  0:00       ` Matthew Heaney
1997-03-16  0:00         ` Robert Dewar
1997-03-19  0:00           ` Dale Stanbrough
1997-03-21  0:00             ` Robert Dewar
replies disabled

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