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

third


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

Syntax

(third expr)
expr - a list or list expression
returns - the third element of expr or NIL

Description

The 'third' function returns the third element of a list or list expression. If the list is NIL , NIL is returned.

Examples

(third '(1 2 3 4))                       ; returns 3
(third NIL)                              ; returns NIL

(setq kids '(junie vickie cindy chris))  ; set up variable KIDS
(first kids)                             ; returns JUNIE
(second kids)                            ; returns VICKIE
(third kids)                             ; returns CINDY
(fourth kids)                            ; returns CHRIS
(rest kids)                              ; returns (VICKIE CINDY CHRIS)

Note: This function is set to the same code as caddr.

See the third function in the XLISP 2.0 manual.

  Back to Top


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