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?

gh_lookup should work, but it only looks up things in the root module.

(Yes, the current gh_lookup is a strange thing to have in an
 interpreter with a module system.)

> 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 suppose you didn't define it in the root module, but in the module
`guile-user' which is the module you are in when you start the repl.

> Why are there two symhash tables, a weak one and a non-weak one?

I suppose the motivation behind the weak one is that it should be
possible to forget symbols not used any longer.  Then, there are
symbols which shouldn't be forgotten, therefore the non-weak one.

I think it would be simpler and nicer just to use a weak one.

> Why does the (defined?) procedure go about things in a totally
> different manner to gh_lookup() and (symbol-bound?) go about what
> seems to me to be much the same task? Is there some tricky closure
> thingy going on?

symbols.c is a mess.  That part of Guile should be rewritten.

/mdj