Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

boundp

boundp( 
s_arg 
[ e_environment ] 
) 
=> t / nil

Description

Checks if the variable named by a symbol is bound, that is, has been assigned a value. The single argument form of boundp only works in SKILL mode.

Remember that a variable can be set to the special symbol unbound.

The boundp() function does not check the current language mode. If single argument is specified, SKILL semantics are used, whereas if two arguments are specified, SKILL++ semantics are used.

Arguments

s_arg

Symbol to be tested to see if it is bound.

e_environment

If this argument is given, SKILL++ semantics are used. The symbol will be searched for within the given (lexical) environment.

Value Returned

t

If the symbol s_arg has been assigned a value.

nil

If the symbol s_arg has not been assigned a value.

Examples

x = 5                ; Binds x to the value 5.
y = 'unbound ; Unbind y
boundp( 'x )
=> t
boundp( 'y )
=> nil
y = 'x               ; Bind y to the constant x.
boundp( y )
=> t ; Returns t because y evaluates to x,
; which is bound.

Related Topics

Core Functions


Return to top
 ⠀
X