From: Mari
Subject: Common Lisp rotatef question
Date: 
Message-ID: <Pine.hpx.3.96.971019200212.24662C-100000@host-00.colby.edu>
How does rotatef work in Common Lisp?  I am trying to figure out how to
rotate all of the elements of a list one position to the left so the
second element becomes the first, the third element becomes the second,
etc., and the first element goes to the end of the list.  Since I am
trying to do this in the run loop of a Common Lisp Music instrument
definition, I am only allowed to use certain operators (if that's what
they are called -- I am new to Lisp) and rotatef sounds like it might do
what I want to do.  The other operator I'm allowed to use that sounds like
it might do something along the same lines is shiftf, but I don't know how
to use that either.  

Thanks a lot,

Mari

..................................
 Mari Masuda * ········@colby.edu
 www.colby.edu/personal/mbmasuda/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
From: Kent M Pitman
Subject: Re: Common Lisp rotatef question
Date: 
Message-ID: <sfw4t6d1d3b.fsf@world.std.com>
Mari <········@colby.edu> writes:

> How does rotatef work in Common Lisp?  I am trying to figure out how to
> rotate all of the elements of a list 

I really doubt that ROTATEF or SHIFTF is what you want.  These move
values among a fixed set of places.  Since a list is not a fixed set of
elements, it's a bad match.

Since this sounds like it is for a class, I don't want to give away
the answer.  But I recommend focusing harder on just plain old CDR and
the service it can perform for you.  Hint:
 (CDR '(1 2 3 4)) => (2 3 4)

Good luck.