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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Binary and XML serialization of types Date: Tue, 04 Feb 2014 22:34:15 +0000 Organization: A noiseless patient Spider Message-ID: References: <20a36d96-850e-4020-8dfa-777eb9c944f4@googlegroups.com> <9e27abb7-e944-4bd4-a10c-600fe4da7872@googlegroups.com> <56a5aeb6-8704-457c-a24f-b664746afe72@googlegroups.com> <13pvagjpwejni$.1e8ll5btxg1f5$.dlg@40tude.net> <5bf8c737-b99d-4069-885f-03fe82f06cc6@googlegroups.com> <14k7gbu5ws82b.3pn20kh5ci50.dlg@40tude.net> <1txs6yifzioke$.30cghpl6qq1j$.dlg@40tude.net> <18q1ats1rko50$.zp43ryd37uis.dlg@40tude.net> <51bc4e33-df01-4048-802f-587ef81f93ac@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="f3a204fd0da52c1307d65ca023946f38"; logging-data="1172"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+nM5CY2177lA/WIa2JGVgPGhL/rd0UVQI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:Ce3FXtNIKhkIqPi6BDd1lRe1670= sha1:0eON+zIIhRtQ7ZykwfmVZ0awNF4= Xref: news.eternal-september.org comp.lang.ada:18383 Date: 2014-02-04T22:34:15+00:00 List-Id: AdaMagica writes: > that's why in Ada bits are counted also right to left so that we count > contiguously past byte boundaries. If you are on a BE machine and you are writing a representation clause (Ada < 2012) then, for a byte, the msb is bit 0 and the lsb is bit 7. I'm natively little-endian, and if I'm drawing a 4-byte memory quantity on a single line I will draw the ls byte and the ls bit within it on the right regardless of the intended endianness. I don't know for sure what people whose first computer was big-endian do, but I suspect it's the same (perhaps not for people whose writing system is right-to-left) (but see the third comment in [1], showing that at least one respected individual thinks differently!). So I don't see how "in Ada bits are counted [also] right to left". [1] http://www.adacore.com/adaanswers/gems/gem-140-bridging-the-endianness-gap/