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

last


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

Syntax

(last list-expr)
list-expr - a list or list expression
returns - the last list node in the list

Description

The 'last' function returns a list containing the last node or element of a list. If the last node is a sub-list, this is returned unaffected.

Examples

(last NIL)                     ; returns NIL
(last 'a)                      ; error: bad argument type
(last '(A))                    ; returns (A)
(last '(A B C D E))            ; returns (E)
(last '( A (B C) (D E (F))))   ; returns ((D E (F)))

(setq children '(junie vicki cindy chris))

(last children)                ; returns (CHRIS)

See the last function in the XLISP 2.0 manual.

  Back to Top


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