The 'reverse' function reverses the 'list-expr'. The reversed list is the returned value. The reversal process only occurs on the 'top-level' of the 'list-expr'. If there are nested sub-lists, these are left intact.
(reverse NIL) ; returns NIL (reverse 'a) ; error: bad argument type (reverse '(a)) ; returns (A) (reverse '(a b c)) ; returns (C B A) (reverse '((a b) (c d) (e f))) ; returns ((E F) (C D) (A B)) (reverse (list (+ 1 2) (+ 3 4))) ; returns (7 3)
See the
reverse
function in the