XLISP fboundp

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# fboundp

Type: | - | predicate function (subr)
Source: | - | xlbfun.c

## Syntax

(fboundp symbol)
  symbol - the symbol expression to check for a value
  returns - T if a functional value is bound to the symbol, NIL otherwise

## Description

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.

## Examples

    (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 XLISP 2.0 manual.

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference