type: predicate function (subr) location: built-in source file: xlbfun.c Common LISP compatible: yes supported on: all machines
(fboundp <symbol> ) <symbol> - the symbol expression to check for a value
The FBOUNDP predicate checks to see if <symbol> is a symbol with a function definition (closure) 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 - value is closure (fboundp 'defvar) ; returns T - value is closure (fboundp 'car) ; returns T - value is closure (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"