XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

nthcdr


Type:   -   function (subr)
Source:   -   xllist.c

Syntax

(nthcdr expr list-expr)
expr - an integer expression
list-expr - a list or list expression
returns - the nth cdr or NIL if the list isn't that long

Description

'nthcdr' returns the 'expr'-th cdr of 'list-expr'. If the 'list-expr' is shorter than 'exp', a NIL is returned. The counting sequence is base zero, the first element is the 0th element.

Examples

(nthcdr 4 '(0 1 2 3 4 5 6))  ; returns (4 5 6)
(nthcdr 3 '(a b))            ; returns NIL

(nthcdr 4 'a)                ; error: bad argument type

See the nthcdr function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next