"Well, I'm back." he said ...
Well the only thing I can surmise is that the function you posted in your initial thread didn't represent what you were actually using off line.
To be more direct, you posted this:
(defun rot_lst ( / )
(setq foo (append (cdr foo) (list (car foo))))
)
Whereas I'm guessing you were actually using this:
(defun rot_lst ( [color=red]foo[/color] )
(setq foo (append (cdr foo) (list (car foo))))
)
Using the second definition thusly:
(setq lst '(A B C))(rot_lst lst) => (B C A)While
(rot_lst lst) returns
(B C A) the variable
lst will still be bound to
(A B C). Why? Because the argument
foo hosts a copy of the data, not the original -- any changes made to
foo are local to the
rot_lst function and independent of the external variable
lst. So while
(rot_lst lst) returns the result you want, said results are not permanent -- unless you capture them:
(setq lst (rot_lst lst))Then again I've quite likely missed your point, but unfortunately I cannot help myself; sorry + shrug.