comp.lang.ada
 help / color / mirror / Atom feed
From: Guillaume <guifo@wanadoo.fr>
Subject: Re: First time Ada has let me down (recipe)
Date: 2000/10/25
Date: 2000-10-25T20:09:29+00:00	[thread overview]
Message-ID: <8t7elp$n8h$1@wanadoo.fr> (raw)
In-Reply-To: 8FD7DEBEEsynoptikdamudderfuck@news


> 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




  reply	other threads:[~2000-10-25  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-25  3:50 First time Ada has let me down Shifty
2000-10-25  0:00 ` Guillaume [this message]
2000-10-26  2:45   ` First time Ada has let me down (recipe) Mats Weber
2000-10-25  0:00 ` First time Ada has let me down wv12
2000-10-25  0:00   ` Joel Seidman
2000-10-25  0:00   ` Gisle Sælensminde
2000-10-25  0:00   ` Gautier
2000-10-26  6:42   ` tmoran
2000-10-25  0:00 ` Larry Kilgallen
2000-10-25  0:00   ` Ted Dennison
2000-10-25  0:00     ` Larry Kilgallen
2000-10-25  0:00       ` Ted Dennison
2000-10-25  0:00 ` Ken Garlington
2000-10-25  0:00   ` Shifty
2000-10-26  4:00     ` Jeff Carter
2000-10-26 14:43       ` Ted Dennison
2000-10-26 17:55         ` tmoran
2000-10-26 17:12       ` Shifty
2000-10-27  1:00         ` Jeff Carter
2000-10-26 22:27       ` Guillaume
2000-10-26 21:49         ` Keith Thompson
2000-10-26 14:36     ` Ted Dennison
2000-10-26 17:55       ` tmoran
2000-10-26 23:08         ` Ted Dennison
2000-10-25  4:44 ` Julian Morrison
2000-10-25  4:50 ` Ted Dennison
2000-10-24  0:00   ` Keith Thompson
2000-10-26  0:00   ` Andreas Schulz
2000-10-26 18:05     ` Alejandro Villanueva
2000-10-26 21:46 ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox