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,36b302576d78847a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!atl-c08.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: How do you bitwise operations in Ada '83 and '95 References: From: Stephen Leake Date: Fri, 21 Jul 2006 06:07:29 -0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:C/HWl8NsVuBRWru0CszVkzxzJC4= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 8430944c0a763e73ae4a405243 Xref: g2news2.google.com comp.lang.ada:5858 Date: 2006-07-21T06:07:29-04:00 List-Id: Simon Wright writes: > tmoran@acm.org writes: > >> Ada is designed to be highly readable and to aid in creating >> correct programs. Surely a record rep clause, and then simple usage >> of its components, is more readable, and more likely to be correct, >> and even more likely to generate optimized code, than source code >> littered with complex arithmetic expressions. > > Unless you are concerned with endian-independence, of course, when the > rep clause becomes highly incomprehensible. Not in Ada 2005; 'Bit_Order is required to work "nicely" to make endian-independent rep clauses. See AI95-00133 and http://www.ada-auth.org/ai-files/grab_bag/bitorder.pdf. However, not even GNAT implements this yet. We need to put more pressure on the compiler vendors. Or be more patient :). > I have a feeling that shift&mask ends up more understandable Never. > and reviewable. In Ada 95, maybe. In Ada 2005, not. -- -- Stephe