Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

newbie question: left and right-rotation

5 views
Skip to first unread message

The Flash

unread,
Jul 11, 1999, 3:00:00 AM7/11/99
to
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 ja...@ip.pt since I am having problems in accessing
newsgroupos. Thanks again !

R. Matthew Emerson

unread,
Jul 11, 1999, 3:00:00 AM7/11/99
to
l42...@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

0 new messages