nreverse (a standard function in Common Lisp) works like reverse, but destructively modifies its input list by turning the pointers around.
> (define lst '(a b c)) lstnreverse can be implemented as follows:> (define back (nreverse lst)) back
> back (c b a)
> lst (a)
(define (nreverse x) (let ((last '()) (tmp '())) (while (pair? x) (set! tmp (cdr x)) (set-cdr! x last) (set! last x) (set! x tmp)) last))
Contents    Page-10    Prev    Next    Page+10    Index