From: The Flash
Subject: newbie question: left and right-rotation
Date: 
Message-ID: <7mafe7$7l4$1@utl2.reitoria.utl.pt>
	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 !
From: R. Matthew Emerson
Subject: Re: newbie question: left and right-rotation
Date: 
Message-ID: <87r9merj1p.fsf@nightfly.apk.net>
······@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