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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b657b1c99e7e7039 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!feeder.news-service.com!feeder.erje.net!newsfeed.freenet.ag!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: bit numbers in packed arrays of Boolean Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <82r5hfghjr.fsf@stephe-leake.org> <8e4b6rF1dlU1@mid.individual.net> Date: Tue, 31 Aug 2010 15:08:02 +0200 Message-ID: <108mw0hcfwlnl.1klsp2e3omofa.dlg@40tude.net> NNTP-Posting-Date: 31 Aug 2010 15:08:02 CEST NNTP-Posting-Host: 756e81fb.newsspool4.arcor-online.net X-Trace: DXC=hDW;^AYiGGTYQ5E:l 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 > 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