The 'atom' predicate checks if the 'expr' is an atom. T is returned if 'expr' is an atom, NIL is returned otherwise.
(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 .
See the