I'm looking for a few data stack routines - specifically push, pop, rollup and rolldown. I did a google search and got a fair number of hits for common lisp, but nothing for lisp.
I have put together the following but am open to suggestions:
(defun ListRollUp(lst /)
;;'(1 2 3) becomes (3 1 2)
(cons (car(reverse lst)) (reverse (cdr (reverse lst))))
)
(defun ListRollDown(lst / )
;;'(1 2 3) becomes (2 3 1)
(reverse (cons (car lst) (reverse (cdr lst))))
)
Any suggestions are welcome.
Mike