The 'boundp' predicate function tests if 'symbol' evaluates to a symbol
in
(setq a 1) => 1 ; create a variable A in the *OBARRAY* (boundp 'a) => T ; variable A has a value 1 (let ((b 'value)) (boundp b)) => NIL ; BOUNDP does NOT test LET bindings (defun foo (x) ; create a function FOO in the *OBARRAY* (print x)) => FOO (boundp 'foo) => NIL ; FOO is not a variable (print myvar) => error: unbound variable - MYVAR (boundp 'myvar) => NIL (setq myvar 'abc) ; give MYVAR a value (boundp 'myvar) => T
Note that 'symbol' is a symbol expression. This means that 'symbol' is evaluated and the return value is tested:
(setq myvar 'qq) ; MYVAR evaluates to QQ (boundp myvar) => NIL ; but QQ has no value yet (setq qq 'new-value) ; give QQ a value (boundp myvar) => T
See also: