[gambit-list] getting symbol table

Christian Jaeger christian at pflanze.mine.nu
Wed Jul 30 17:28:12 EDT 2008

Nguyen Thai Ngoc Duy wrote:
> Hi,
> Is there any way to get global symbol table from scheme? (Because I
> see that symbol completion is done in C).

You can get the ___GSTATE->symbol_table by calling (##symbol-table); 
this is not a normal Gambit hash table (it predated Gambit's hash table 
implementation, and maybe there are reasons to leave it at what it is); 
it's a vector with some number in the first position -- so, how you work 
with that depends on what you want to do with it. For one, you can use 
##object->global-var to map a procedure value back to a symbol holding 
it. Maybe there are a few more Scheme wrappers, I haven't looked closely 
enough, check _kernel.scm, setup.c, and maybe a few other files.

Check cj-symbol*scm from http://scheme.mine.nu/gambit/preview/ for how I 
did it. (And I welcome suggestions and patches to that file.)


More information about the Gambit-list mailing list