The 'consp' predicate checks if the 'expr' is a non-empty list.
T is returned if 'expr' is a
list, NIL is returned otherwise. Note that
if the 'expr' is
(consp '(a b)) ; returns T - list (consp '(a . b)) ; returns T - dotted pair list (consp #'defvar) ; returns NIL - closure - macro (consp (lambda (x) (print x))) ; returns NIL - closure - lambda (consp NIL) ; returns NIL - NIL (consp #(1 2 3)) ; returns NIL - array (consp *standard-output*) ; returns NIL - stream (consp 1.2) ; returns NIL - float (consp #'quote) ; returns NIL - fsubr (consp 1) ; returns NIL - integer (consp object) ; returns NIL - object (consp "str") ; returns NIL - string (consp #'car) ; returns NIL - subr (consp 'a) ; returns NIL - symbol
Note: When applied to 'consp',
See the
consp
predicate function in the