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

characterp


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

Syntax

(characterp expr)
expr - the expression to check
returns -  T  if the value is a character, NIL otherwise

Description

The 'characterp' predicate function tests if 'expr' evaluates to a character.  T  is returned if 'expr' evaluates to a character, NIL is returned otherwise.

Examples

(characterp #\a)       => T    ; character
(setq a #\b)           => #\b
(characterp a)         => T    ; evaluates to a character
(characterp "a")       => NIL  ; string
(characterp '(a b c))  => NIL  ; list
(characterp 1)         => NIL  ; integer
(characterp 1.2)       => NIL  ; float
(characterp 'a)        => NIL  ; symbol
(characterp #(0 1 2))  => NIL  ; array
(characterp nil)       => NIL  ; NIL

See also:

  Back to Top


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