[plt-scheme] testing if a variable is bound
> How does one test if a variable is bound?
>
> MIT/GNU Scheme has this:
> http://www.gnu.org/software/mit-scheme/documentation/scheme_14.html
Hi Geoffrey,
I think something like namespace-mapped-symbols from the namespace
utilities may do the trick:
http://download.plt-scheme.org/doc/300/html/mzscheme/mzscheme-Z-H-8.html#node_sec_8.3
For example:
;;;;;;
> (and (member 'square (namespace-mapped-symbols)) #t)
#f
> (define square (lambda (x) (* x x)))
> (and (member 'square (namespace-mapped-symbols)) #t)
#t
;;;;;;
Best of wishes!