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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,24d7acf9b853aac8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: S-expression I/O in Ada Date: Mon, 9 Aug 2010 20:17:40 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <547afa6b-731e-475f-a7f2-eaefefb25861@k8g2000prh.googlegroups.com> <258zlxrv4fn6.1vszho1rtmf48$.dlg@40tude.net> <984db477-973c-4a66-9bf6-e5348c9b95f2@n19g2000prf.googlegroups.com> <46866b8yq8nn$.151lqiwa0y2k6.dlg@40tude.net> <13b07f2c-2f35-43e0-83c5-1b572c65d323@y11g2000yqm.googlegroups.com> <13tpf7ya3evig$.h05p3x08059s$.dlg@40tude.net> <1omt2srxtpsga$.c3hbxthzo6cf.dlg@40tude.net> <1e4cch2df5uyb.18brqdd16dhv8.dlg@40tude.net> <14y70ke8am9qw$.2csc9eflvigg.dlg@40tude.net> <1y1c8zzqmcer5.po56hkesa968.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1281403066 19985 69.95.181.76 (10 Aug 2010 01:17:46 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 10 Aug 2010 01:17:46 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-RFC2646: Format=Flowed; Original Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feed.ac-versailles.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail Xref: g2news1.google.com comp.lang.ada:13032 Date: 2010-08-09T20:17:40-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1y1c8zzqmcer5.po56hkesa968.dlg@40tude.net... ... >> For these, you don't want modular semantics -- you just want >> a data type whose representation matches what you're >> interfacing/communicating with, such as "type Octet is >> range 0..2**8-1;" > > The problem is that these things require both array-of-Boolean view and > arithmetic. I agree that when arithmetic is used, then it has to be wide. > E.g. when interpreting sequences of octets as little/big endian numbers, > we > never use modular arithmetic. But integer arithmetic is incompatible with > array/set view. What have you done with Dmitry?? You can't be the *real* Dmitry! :-) Array-of-bytes views and arithmetic views are of clearly different types, with different sets of operations. These shouldn't be mixed, logically or any other way. If you need to go between these views, you need some sort of type conversion (or Unchecked_Conversion or Stream'Read or...). Thus, it is *never* necessary to do operations on both views at once, and it is irrelevant what the "math" operations for octets is. If Ada gets anything wrong about this, it is that it has math operations at all for stream_elements. The Dmitry I now certainly understands this, so I wonder what you've done with him... :-) Randy.