comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: bit numbers in packed arrays of Boolean
Date: Tue, 31 Aug 2010 15:08:02 +0200
Date: 2010-08-31T15:08:02+02:00	[thread overview]
Message-ID: <108mw0hcfwlnl.1klsp2e3omofa.dlg@40tude.net> (raw)
In-Reply-To: op.viayuwspule2fv@garhos

On Tue, 31 Aug 2010 14:41:10 +0200, Yannick Duch�ne (Hibou57) wrote:

> Le Tue, 31 Aug 2010 14:34:35 +0200, Niklas Holsti  
> <niklas.holsti@tidorum.invalid> a �crit:
>> Well, not quite, as I understand that point in the LRM. It says that  
>> (under several conditions) the *value* of the object Bits has the same  
>> representation as the *value* of the object Word.
> I suppose, for scalar types only, isn't it ? An exact reference would be  
> welcome anyway. Can you recall one please ?

RM 13.1(//2):

"The representation of an object consists of a certain number of bits (the
size of the object). For an object of an elementary type, these are the
bits that are normally read or updated by the machine code when loading,
storing, or operating-on the value of the object. For an object of a
composite type, these are the bits reserved for this object, and include
bits occupied by subcomponents of the object. If the size of an object is
greater than that of its subtype, the additional bits are padding bits. For
an elementary object, these padding bits are normally read and updated
along with the others. For a composite object, padding bits might not be
read or updated in any given composite operation, depending on the
implementation."

The representation = memory pattern. When RM says that S and T have same
representation that is merely same pattern. It tells nothing about ordering
of bits. Any combination of 8-bits is same representation of Unsigned_8 and
Boolean array (1..8).

So I think Niklas is right.

I don't even know if 2**n Unsigned_8 should produce a singleton array. E.g.
it is possible, but unlikely, that 2 could become (True, False, True, True,
True, False, True, False).

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2010-08-31 13:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31 11:14 bit numbers in packed arrays of Boolean Stephen Leake
2010-08-31 11:34 ` Yannick Duchêne (Hibou57)
2010-08-31 12:34 ` Niklas Holsti
2010-08-31 12:41   ` Yannick Duchêne (Hibou57)
2010-08-31 13:08     ` Dmitry A. Kazakov [this message]
2010-08-31 13:40       ` Yannick Duchêne (Hibou57)
2010-08-31 13:57         ` sjw
2010-08-31 14:07         ` Dmitry A. Kazakov
2010-08-31 14:30         ` Niklas Holsti
2010-09-02 20:09   ` Randy Brukardt
2010-08-31 18:13 ` Jeffrey Carter
replies disabled

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