Hello there !
I'm new to lisp and i need to know if there is any function that
performs a left-rotation of words, like x << y in C. The only rotation
function i've found was rotatef but that doesn't do what i want.
Could somebody give me some hints ?
Thnaks in advance !
Jorge Tavares
PS - please, answer to ····@ip.pt since I am having problems in accessing
newsgroupos. Thanks again !
······@alfa.ist.utl.pt (The Flash) writes:
> I'm new to lisp and i need to know if there is any function that
> performs a left-rotation of words, like x << y in C. The only rotation
> function i've found was rotatef but that doesn't do what i want.
>
(ash i n) will shift the integer i left by n bits.
(ash i -n) will shift the integer i right by n bits.
use logand/logior/etc. to mask as needed, if the C bit idioms
are ingrained in your brain. you could also use ldb.
-matt