XLISP null

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# null

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

## Syntax

(null expr)
  expr - the expression to check
  returns - T if the list is empty, NIL otherwise

## Description

The 'null' predicate function checks 'expr' for an empty list. T is returned if the list is empty, NIL is returned otherwise. The 'expr' does not have to be a valid list, but if it is not a list then NIL is returned as the result.

## Examples

    (null '())     ; returns T - empty list
    (null ())      ; returns T - still empty
    (setq a NIL)   ; set up a variable
    (null a)       ; returns T - value = empty list

    (null "a")     ; returns NIL - not a list
    (null 'a)      ; returns NIL - not a list

Note: The 'null' predicate function is the same function as the not predicate function.

See the null predicate function in the XLISP 2.0 manual.

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference