Function: boundp
boundp is a function defined in data.c.
Signature
(boundp SYMBOL)
Documentation
Return t if SYMBOL's value is not void.
Note that if lexical-binding is in effect, this refers to the
global value outside of any lexical scope.
Probably introduced at or before Emacs version 16.
Source Code
// Defined in /usr/src/emacs/src/data.c
{
Lisp_Object valcontents;
struct Lisp_Symbol *sym;
CHECK_SYMBOL (symbol);
sym = XSYMBOL (symbol);
start:
switch (sym->u.s.redirect)
{
case SYMBOL_PLAINVAL: valcontents = SYMBOL_VAL (sym); break;
case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
case SYMBOL_LOCALIZED:
{
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
if (blv->fwd.fwdptr)
/* In set_internal, we un-forward vars when their value is
set to Qunbound. */
return Qt;
else
{
swap_in_symval_forwarding (sym, blv);
valcontents = blv_value (blv);
}
break;
}
case SYMBOL_FORWARDED:
/* In set_internal, we un-forward vars when their value is
set to Qunbound. */
return Qt;
default: emacs_abort ();
}
return (BASE_EQ (valcontents, Qunbound) ? Qnil : Qt);
}