This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: gh_lookup no longer works??
- To: stevenj@hunsmac.mit.edu (Steven G. Johnson)
- Subject: Re: gh_lookup no longer works??
- From: Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
- Date: 29 Aug 1999 21:35:36 +0200
- Cc: guile@sourceware.cygnus.com, russe@ms.com
- Cc: djurfeldt@nada.kth.se
- References: <9908270029.AA08295@hunsmac.mit.edu>
stevenj@hunsmac.mit.edu (Steven G. Johnson) writes:
> Russell McManus <russe@ms.com> wrote:
> >Take a look at the guile FAQ, and read the
> >http://www.gnu.org/software/guile/docs/faq/guile-faq.html#TOC_14
> >entry.
>
> I don't think the module system (which this FAQ entry describes) is
> the problem, since I'm not using modules.
Well, still, this is the problem, unfortunately.
The problem is that gh_lookup looks up variables in the root module
(guile), while gh_eval_str evaluates strings in the module selected as
"current" by the repl.
When your application starts, the "current" module is (guile-user).
So, if you, in your test program, do:
(define-module (guile))
(define foo 1)
(tst)
the two behaviours will coincide, and gh_lookup will find the symbol.
The real bug is in the gh interface itself since it doesn't define
which behaviour is intended. Since both behaviours are potentially
useful, and since I can imagine that many users depend on either, I'm
not going to fix this now.
We'll provide a better interface when we have the new module system.