The 'fboundp' predicate function checks to see if 'symbol' is a symbol with a function definition bound to it. T is returned if 'symbol' has a function value, NIL is returned otherwise. Note that 'symbol' is a symbol expression, it is evaluated and the resulting expression is the one that is checked.
(defun foo (x) (print x)) ; set up function FOO (fboundp 'foo) ; returns T - FOO is closure (fboundp 'car) ; returns T - CAR is subr (setq myvar 'goo) ; set up MYVAR to have value GOO (fboundp myvar) ; returns NIL - because GOO has no value yet (defmacro goo () (print "hi")) ; define GOO macro (fboundp myvar) ; returns T (fboundp 'a) ; returns NIL (fboundp '1) ; error: bad argument type - 1 (fboundp "hi") ; error: bad argument type - "hi"
See the
fboundp
predicate function in the