newbie question: left and right-rotation 
Author Message
 newbie question: left and right-rotation

        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


newsgroupos. Thanks again !



Thu, 27 Dec 2001 03:00:00 GMT  
 newbie question: left and right-rotation

Quote:

>    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



Thu, 27 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Right, left, Right.

2. Right to left question

3. Right to left cursor utility

4. Hebrew and Right-to-Left

5. left mouse button = right mouse button

6. How to make a check right before leaving a program

7. Relational Trees - ? Scroll Left to Right

8. bold, italic, underline and right & left alignment

9. Hove to shift page numbers from left to right side depending on even uneven pagenumber

10. LEFT AND RIGHT ARROWS TO CHANGE SORT ORDER

11. Have a Get as a calculator (right to left)

12. More MF.Fun WORD-RIGHT and WORD-LEFT

 

 
Powered by phpBB® Forum Software