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,81bce7ee9133fb42 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: GNAT Ada for DOS - Reading Integers Problem Date: 1996/02/23 Message-ID: #1/1 X-Deja-AN: 140826269 references: <4g2efj$d5d@susscsc1.rdg.ac.uk> <4gdivm$10f5@watnews1.watson.ibm.com> <4gfsuq$10f5@watnews1.watson.ibm.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-02-23T00:00:00+00:00 List-Id: In article <4gfsuq$10f5@watnews1.watson.ibm.com>, Norman H. Cohen wrote: > type Byte_Swapped_Half_Word is new Half_Word; > > for Byte_Swapped_Half_Word'Bit_Order use High_Order_First; > >causing Byte_Swapped_Half_Word to inherit the literal text > > Low at 0 range 0 .. 7; > High at 0 range 8 .. 15; > >from its parent's record representation clause, but to interpret that >text big-endianly instead of little-endianly! >(Fortunately, the Founding Fathers follow this newsgroup and can provide >a definitive answer about their Original Intent.) Well, *this* Founding Father can't. I have to admit that I never thought about this particular example. However, I think that's what the RM says -- you inherit the record rep clause, but you override the bit order. That seems like the only reasonable intepretation. Note that the above is illegal if there are any inherited subprograms lurking around (which is quite often the case). - Bob