The 'symbolp' predicate function checks if an 'expr' is a valid symbol. T is returned if 'expr' is a symbol, NIL is returned otherwise. An 'expr' that evaluates to an integer, function [subr or otherwise], and so on is not a symbol. However, the quoted [un-evaluated] name of these objects [like 'myarray] is a valid symbol.
(symbolp (make-symbol "a")) ; returns T - symbol (symbolp 'a) ; returns T - symbol (symbolp #(1 2 3)) ; returns NIL - array (symbolp (lambda (x) (print x))) ; returns NIL - closure (symbolp *standard-output*) ; returns NIL - stream (symbolp 1.2) ; returns NIL - float (symbolp 2) ; returns NIL - integer (symbolp object) ; returns NIL - object (symbolp "hi") ; returns NIL - string (symbolp #'car) ; returns NIL - subr (symbolp 'car) ; returns T - it is a symbol now (symbolp '2) ; returns NIL - not a symbol
See the
symbolp
predicate function in the