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.

rest

rest

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

SYNTAX

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

DESCRIPTION

REST returns the remainder of a list or list expression after first element of the list is removed. If the list is NIL, NIL is returned.

EXAMPLES

(rest '(a b c))                         ; returns (B C)
(rest '((a b) c d))                     ; returns (C D)
(rest NIL)                              ; returns NIL
(rest 'a)                               ; error: bad argument type
(rest '(a))                             ; returns NIL
                                        ;
(setq sisters '(virginia vicki cindy))  ; set up variable SISTERS
(first sisters)                         ; returns VIRGINIA
(rest sisters)                          ; returns (VICKI CINDY)

NOTE: The REST function is set to the same code as CDR.


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