Scheme: list all bindings in scope

206 Views Asked by At

In R7RS or chibi-scheme, is there a function I can call to get a list of symbols containing all bindings in the current scope?

As a comparison, in Python, I can use functions globals() and locals() to see what names are available in the current scope.

I'm learning scheme and I think it would be pretty useful for exploring the language if a feature like that were available.

1

There are 1 best solutions below

0
On

No, there's no such procedures are defined in R7RS. For Chibi, Environment object contains all bindings of the environment, however, it can't be accessed from Scheme world.

If you are using REPL on Chibi, you may want to check the (chibi repl): http://synthcode.com/scheme/chibi/lib/chibi/repl.html