This is the mail archive of the guile@sourceware.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 no longer works??


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.

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