User Tools


Function FBOUNDP

Syntax

  • fboundp namegeneralized-boolean

Arguments and Values

Description

Returns true if name is fbound; otherwise, returns false.

Examples

(fboundp 'car)

true

(fboundp 'nth-value)

false

(fboundp 'with-open-file)

true

(fboundp 'unwind-protect)

true

(defun my-function (x) x)

MY-FUNCTION

(fboundp 'my-function)

true

(let ((saved-definition (symbol-function 'my-function))) (unwind-protect (progn (fmakunbound 'my-function) (fboundp 'my-function)) (setf (symbol-function 'my-function) saved-definition)))

false

(fboundp 'my-function)

true

(defmacro my-macro (x) `',x)

MY-MACRO

(fboundp 'my-macro)

true

(fmakunbound 'my-function)

MY-FUNCTION

(fboundp 'my-function)

false

(flet ((my-function (x) x)) (fboundp 'my-function))

false

Side Effects

None.

Affected By

None.

Exceptional Situations

Should signal an error of type type-error if name is not a function name.

See Also

Notes

It is permissible to call symbol-function on any symbol that is fbound.

fboundp is sometimes used to "guard" an access to the function cell, as in:

(if (fboundp x) (symbol-function x))

Defining a setf expander F does not cause the setf function (setf F) to become defined.

\issue{FUNCTION-NAME:LARGE} \issue{SETF-FUNCTIONS-AGAIN:MINIMAL-CHANGES}