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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8309f2bc055237c4 X-Google-Attributes: gid103376,public From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) Subject: Re: Bit manipulation Date: 2000/11/08 Message-ID: #1/1 X-Deja-AN: 691257421 References: <8u8v6n$b7o$1@nnrp1.deja.com> <2WTH$pdrCfOd@eisner.decus.org> <8ub6kt$6nd$1@nnrp1.deja.com> <8ubeq8$cgm$1@nnrp1.deja.com> <8ubhlh$ejv$1@nnrp1.deja.com> X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 973701644 216.44.122.34 (Wed, 08 Nov 2000 16:40:44 GMT) Organization: LJK Software NNTP-Posting-Date: Wed, 08 Nov 2000 16:40:44 GMT Newsgroups: comp.lang.ada Date: 2000-11-08T00:00:00+00:00 List-Id: In article <8ubhlh$ejv$1@nnrp1.deja.com>, gdemont@my-deja.com writes: > >> Of course we could give a simple answer involving the >> obvious solution of converting Character'Pos values to >> a modular type and then doing shifts and masks in the >> normal manner, but that would be a disservice. >> >> I see a *lot* of code that is clearly written by C programmers >> and greatly overuses low level bit twiddling techniques that >> are appropriate to C but not to Ada. >> >> If someone simply wants to get a job done in the dirtiest >> possible fashion, and wants someone else to do the work, >> CLA is not the place to expect free help :-) > > I'm not sure that Mr Binetti intends to do dirty things. Nor was anyone else, and there are even points where Ada experts will disagree as to what "dirty" means. The point is to make the discussion more full, and perhaps we will all learn about an environment where bit masking is required (such as the stream cipher case alluded to by John English). Perhaps we will learn that careful type declaration will "totally solve" the problem at hand. Or perhaps we will learn something unanticipated.