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

endp


Type:   -   predicate function (subr)
Source:   -   xlbfun.c

Syntax

(endp list)
list - the list to check
returns -  T  if the list is empty, NIL otherwise

Description

The 'endp' predicate function checks to see if 'list' is an empty list.  T  is returned if the list is empty, NIL is returned if the list is not empty. The 'list' has to be a valid list. An error is returned if it is not a list:

error: bad argument type

Examples

(endp '())       ; returns T - empty list
(endp ())        ; returns T - still empty
(endp '(a b c))  ; returns NIL
(setq a NIL)     ; set up a variable
(endp a)         ; returns T - value = empty list
(endp "a")       ; error: bad argument type - "a"
(endp 'a)        ; error: bad argument type - A

Note: The 'endp' predicate is different from the null and not predicates in that it requires a valid list.

See the endp predicate function in the XLISP 2.0 manual.

  Back to Top


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