Previous: Internal Definitions, Up: Binding Constructs


25.4 Querying variable bindings

Guile provides a procedure for checking whether a symbol is bound in the top level environment. If you want to test whether a symbol is locally bound in expression, you can use the bound? macro from the module (ice-9 optargs-kw), documented in Optional Arguments.

— Scheme Procedure: defined? sym [env]
— C Function: scm_definedp (sym, env)

Return #t if sym is defined in the lexical environment env. When env is not specified, look in the top-level environment as defined by the current module.