This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gh_lookup()


Tel <telford@eng.uts.edu.au> writes:

> Has anyone got gh_lookup() to work?

The modules system is biting you in the rear, I would guess.

> I define a symbol from scheme using (define blah 123)
> and then try to get the top-level definition using gh_lookup()
> but the result is always undefined...

I suspect that gh_lookup is looking in the 'the-root-module', and in
scheme, your (define blah 123) happened in the 'guile-user'.  Or maybe
vice versa.

You can figure out where you are at the repl with:

  (module-name (current-module))

Another neat thing to figure out this module stuff is 'apropos'.  It
takes a regular expression, and returns a table of information about
every symbol in the system that matches the regexp.  The information
included in which module the symbol is defined, which helps greatly
when debugging such problems.

I hope this helps,
-russ

--
There is always free cheese in a mousetrap.