[plt-scheme] testing if a variable is bound

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Wed Jan 11 04:43:54 EST 2006

> 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:


For example:

> (and (member 'square (namespace-mapped-symbols)) #t)
> (define square (lambda (x) (* x x)))
> (and (member 'square (namespace-mapped-symbols)) #t)

Best of wishes!

Posted on the users mailing list.