fork download
  1. (defun my-nreverse-1 (l)
  2. (my-nreverse-1-aux l nil))
  3.  
  4. (defun my-nreverse-1-aux (l next)
  5. (if (null l)
  6. next
  7. (let ((buf (rest l)))
  8. (setf (rest l) next)
  9. (my-nreverse-1-aux buf l))))
  10.  
  11. (defparameter *x* '(1 (2 3) 4 (5 6) 7 8))
  12. (princ (nreverse *x*))
Success #stdin #stdout 0.02s 10520KB
stdin
Standard input is empty
stdout
(8 7 (5 6) 4 (2 3) 1)