next up previous
Contents Next: secondthird, etc. Up: Appendix: Selected LISP Previous: read (FUNCTION)

reverse (FUNCTION)

Format: (reverse <list>)

Required arguments: 1

<list>: An expression which returns a list.

Reverse returns a list that contains all the elements of <list> in reversed order.

Examples:

>(reverse '(picard riker worf crusher))
(CRUSHER WORF RIKER PICARD)

>(reverse (reverse '(picard riker worf crusher)))
(PICARD RIKER WORF CRUSHER)

>(reverse '((this list) (of words)))
((OF WORDS) (THIS LIST))



© Colin Allen & Maneesh Dhagat
November 1999