Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

reverse

reverse

type: function (subr) 
location: built-in
source file: xllist.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(reverse <list-expr> )
        <list-expr>     -       a list or list expression

DESCRIPTION

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.

EXAMPLES

(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)


Go to the first, previous, next, last section, table of contents.