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,553a6b79b2471571 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!h48g2000cwc.googlegroups.com!not-for-mail From: "jimmaureenrogers@worldnet.att.net" Newsgroups: comp.lang.ada Subject: Re: How do you bitwise operations in Ada '83 and '95 Date: 18 Jul 2006 14:32:42 -0700 Organization: http://groups.google.com Message-ID: <1153258362.266358.15200@h48g2000cwc.googlegroups.com> References: <1153244316.853254.291560@m79g2000cwm.googlegroups.com> <1153248800.834457.183940@p79g2000cwp.googlegroups.com> NNTP-Posting-Host: 69.170.65.169 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1153258367 1653 127.0.0.1 (18 Jul 2006 21:32:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 18 Jul 2006 21:32:47 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: h48g2000cwc.googlegroups.com; posting-host=69.170.65.169; posting-account=SqOfxAwAAAAkL81YAPGH1JdBwpUXw9ZG Xref: g2news2.google.com comp.lang.ada:5791 Date: 2006-07-18T14:32:42-07:00 List-Id: Jeffrey R. Carter wrote: > jimmaureenrogers@worldnet.att.net wrote: > > > > The following example shows bit-wise operations using a > > packed array of boolean. The small program computes prime > > number using a sieve of Erastosthenese. The array flagging > > found values is implemented as a packed array of boolean. > > No, it doesn't. It simply shows normal array operations on a packed > array of Boolean. I guess that depends upon your definition of bit-wise operations. Very few languages support direct indexing of an array of bits. The equivalent access operations are a lot of nasty bit masking an bit shifting operations. The fact is, with an Ada packed array of boolean you can achieve the same results while maintaining the high level abstraction of an array. Related to bit-wise operations are record representation clauses. Ada differs from C and C++ in ability to control the layout of compound types. Ada provides much finer grained control, allowing one to map types to specific bits, controlling all padding operations, and even allowing fields to cross word boundaries. All these features are part of control of and access to data at the bit level. Ada's abilities in these areas are really quite impressive. Jim Rogers