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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,43ad9ab56ebde91c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.75.170 with SMTP id d10mr19285555pbw.6.1324982354327; Tue, 27 Dec 2011 02:39:14 -0800 (PST) Path: lh20ni69695pbb.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 27 Dec 2011 11:38:32 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Does Ada support endiannes? References: <23835087-313f-427c-b37e-4ff1bdef9d57@r6g2000yqr.googlegroups.com> <20e631fc-e7b4-41ca-be0f-aab8be3f9a25@f33g2000yqh.googlegroups.com> <53n2sd7edt5i.1boh4452h0aks.dlg@40tude.net> <1kc5n51.ffg0umddufyfN%csampson@inetworld.net> <1c2ax12bptm2g.gifwv5vndpxe$.dlg@40tude.net> <1kc8f2j.132xw621jmu761N%csampson@inetworld.net> <16jibtpb9f2o4.1pf3ro8hb8qq2.dlg@40tude.net> <1kcakce.17lpouc1o2nz0gN%csampson@inetworld.net> <1ol1w9audpvta.1drukev3uwfoe.dlg@40tude.net> <1kcu0zg.r0yxxk4341xyN%csampson@inetworld.net> <1tegoy0w6pnqm$.qr7gobrrq1t6$.dlg@40tude.net> In-Reply-To: <1tegoy0w6pnqm$.qr7gobrrq1t6$.dlg@40tude.net> Message-ID: <4ef9a028$0$6622$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 27 Dec 2011 11:38:32 CET NNTP-Posting-Host: caaede5a.newsspool2.arcor-online.net X-Trace: DXC=gg[jZYjmT4:Lh>_cHTX3j=5nS=PBSQ:<9 X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2011-12-27T11:38:32+01:00 List-Id: On 26.12.11 11:47, Dmitry A. Kazakov wrote: > Your code uses obscure assignments to some fields of some record type, Or, as one might say, the expression 256 * Incoming.Byte_2 + Byte_1 is an obscure arithmetical formula involving the magic number 256. It takes careful study by someone with mathematical training and also requires knowledge of language fine print and data representation or else 256 is not meaningful, but obscure! So, regarding obscurity, the formula would at first show little advantage. Neither will it be more readable in this sense. > 4095 -> 2#1111_1111# 2#0111_1111# > 4096 -> 2#1000_0000# 2#1000_0000# 2#0000_0001# > ... > > [Chain codes are used when the upper bound of the transported number is > unspecified and it is expected that lesser values are more frequent than > bigger ones. UTF-8, is chain code.] > > Care to write a representation clause for the above? Arguably, a chain code might not what a regular programmer would see as something to which a record representation clause will apply as a whole. What will the concrete data type for the above chain code look like, as a whole, if it is not a list or array of some sort and if, for example, a chain code is being used precisely because there is a lot more to link than can be represented in what physically corresponds to range 0 .. 2**System.Word_Size? It seems there is value in distinguishing an encoding from a representation, and establish their relationship.