by yoo-interested · 12y ago · 0 comments
(let ((A (vector 2 1)))
(rotatef (elt A
0)
(elt A
(1- (elt A 0))))
A)
It returns a changed vector as if indexes were saved.I am not sure which should be considered the right behavior.
There is also setf and psetf which in the examples I'm giving evaluate from lowest suffix to highest (same as todd8).
(setf expr2 expr1
expr4 expr3)
(psetf expr3 expr1
expr4 expr2)
[0] http://clhs.lisp.se/Body/m_rotate.htm