atom
type: predicate function (subr) location: built-in source file: xlbfun.c Common LISP compatible: yes supported on: all machines
SYNTAX
(atom <expr> )
<expr> - the expression to check
DESCRIPTION
The ATOM predicate checks if the <expr> is an atom. T is returned if <expr> is an atom, NIL is returned otherwise.
EXAMPLES
(atom 'a) ; returns T - symbol
(atom #'atom) ; returns T - subr - function
(atom "string") ; returns T - string
(atom 4) ; returns T - integer
(atom 4.5) ; returns T - float
(atom object) ; returns T - object
(atom #(1 2 3)) ; returns T - array
(atom #'quote) ; returns T - fsubr
(atom *standard-output*) ; returns T - stream
(atom '()) ; returns T - NIL is an atom
(atom #'defvar) ; returns T - closure - macro
(atom (lambda (x) (print x))) ; returns T - closure - lambda
(atom '(a b c)) ; returns NIL - list
(setq a '(a b)) ; set up A with value (A B)
(atom a) ; returns NIL -
; value of A is not an atom
NOTE: NIL or '() is used in many places as a list-class or atom-class expression. Both ATOM and LISTP, when applied to NIL, return T.