[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Keith Price <price@usc.edu>: &Rest failure]



Sure the behavior makes sense.  I don't know where it says this,
but...

&REST cons its argument on the stack.  If you return the result you
get a pointer to somewhere on the stack which by now has probably been
rewritten.  You need to do a copy-list if you want to return a list
consed up by &REST.  It should generally be safe to pass an &rest
argument as a parameter to other functions, e.g.

(defun test (a &rest b) (foo b))

Of course FOO must then make sure it copies B if it wants to return B.

Art