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,ded6ba3fc5b87b66 X-Google-Attributes: gid103376,public From: Guillaume Subject: Re: First time Ada has let me down (recipe) Date: 2000/10/25 Message-ID: <8t7elp$n8h$1@wanadoo.fr>#1/1 X-Deja-AN: 685807833 Content-Transfer-Encoding: 8Bit References: <8FD7DEBEEsynoptikdamudderfuck@news> Content-Type: text/plain; charset=ISO-8859-1 X-Complaints-To: abuse@wanadoo.fr X-Trace: wanadoo.fr 972504569 23825 193.251.35.205 (25 Oct 2000 20:09:29 GMT) Organization: __^__ Mime-Version: 1.0 User-Agent: KNode/0.3.2 NNTP-Posting-Date: 25 Oct 2000 20:09:29 GMT Newsgroups: comp.lang.ada Date: 2000-10-25T20:09:29+00:00 List-Id: > Next morning I tried to implement the solution and couldn't find the Ada > equivalent of C's bit-wise & operater. According to my "Ada as a 2nd > language" book, the Ada reserved word "AND" only works for boolean types, > not integer types. I got the impression that it was up to the programmer > to write his own bitwise ANDs/ORs/XORs, etc (it wouldn't be hard). The RM is your friend : http://www.adahome.com/LRM/83/RM/rm83html/lrm-04-05.html#4.5.1 The recipe : * unchecked conversion to a packed array of booleans * bitwise operation on the array * unchecked conversion the other way It's not as clean as the solution provided in Ada95 with "mod integers", as for one basic operation you're getting two extra copies (the two unchecked conversions). Hope this helps ! Guillaume