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.7 required=5.0 tests=BAYES_00,MSGID_RANDY 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 X-Google-ArrivalTime: 2000-11-07 23:30:09 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!europa.netcrusader.net!208.184.7.66!newsfeed.skycache.com!Cidera!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Sandro Binetti Newsgroups: comp.lang.ada Subject: Re: Bit manipulation Date: Wed, 08 Nov 2000 07:18:53 GMT Organization: Deja.com - Before you buy. Message-ID: <8uauos$vrf$1@nnrp1.deja.com> References: <8u8v6n$b7o$1@nnrp1.deja.com> <2WTH$pdrCfOd@eisner.decus.org> NNTP-Posting-Host: 195.223.220.65 X-Article-Creation-Date: Wed Nov 08 07:18:53 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt) X-Http-Proxy: 1.0 ssi21:3128 (Squid/2.3.STABLE4), 1.0 x52.deja.com:80 (Squid/1.1.22) for client 172.27.66.83, 195.223.220.65 X-MyDeja-Info: XMYDJUIDsandrobinetti Xref: supernews.google.com comp.lang.ada:1876 Date: 2000-11-08T07:18:53+00:00 List-Id: In article <2WTH$pdrCfOd@eisner.decus.org>, Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) wrote: > Quite often when someone wants to do something like that, they had > formerly programmed in some other language whose ability to define > data types is not so robust as Ada. Ok! I'm a C programmer too. Why do you say "robust"? You can write a "robust" source code even by using other languages than ADA. The matter is not that. In this case I'd say "flexible", instead of "not robust". I always discriminate a data structure in two indipendent points of wiew: 1) the semantic one (the type, of course) 2) the sintactic one (the way the type is stored and internally represented) In some occasion, expecially when you work at low-level device handling, you need to approach the problem by a semantic (logic) way, without forgetting that your "idea" has a peculiar way to be treated on the target hardware (and, so, it can't be completely divided from the sintactic approach). That's to say that, in such an occasion like these, there no need (and no meaning) to split the type from its internal representation: it's only a conceptual overhead! > > Except for the particular situation of changing case of an ASCII > Roman letter (for which Ada95 has built-in capabilities), flipping > a bit in a character is totally meaningless. Are you sure? Can you say there'no situation at all in witch you need to manipulate a seven-bit character, regardless of its ASCII semantic? Have you ever thougth of some encryption-encoding algorithm, based on some perverse actions on a character bit? > > If you really meant to blip a bit in a data cell that happens to > be 8 bits wide, then please study record and array declarations > in an introductory Ada text Done, when I was 18! Thanks a lot for your interest in my "stupid" problem. -- Ciao, Sandro Sent via Deja.com http://www.deja.com/ Before you buy.