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: 30 Aug 1999 00:39:31 +0200
- Cc: guile@sourceware.cygnus.com
- Cc: djurfeldt@nada.kth.se
- References: <9908292228.AA22119@hunsmac.mit.edu>
stevenj@hunsmac.mit.edu (Steven G. Johnson) writes:
> Nope, this doesn't work:
>
> guile> (define-module (guile))
> #<module the-root-module 296d8920>
> guile> (define foo 1)
> guile> (tst)
> ERROR: In expression (tst):
> ERROR: Unbound variable: tst
> ABORT: (misc-error)
> Type "(backtrace)" to get more information.
>
> Apparently, "tst" (defined by calling gh_new_procedure in the C program),
> is now defined in the wrong module?
>
> Is it just me, or is there something seriously wrong about this?
Well, I don't know what to say---it works for me, and it should work
since bindings are inherited from (guile) to (guile-user).
> I would think that, unless the user/programmer specifies otherwise,
> both the program code (including all gh_* calls) and any code
> executed by the user should execute in the same module context.
It is important to protect the Guile implementation (guile) from the
user's bindings (guile-user) otherwise Guile will be very unstable,
since the user easily can redefine bindings which the GUile
implementation is dependent upon.
The split between (guile) and (guile-user) is fundamentally good, and
doesn't need to cause trouble. We just need to modify the interface.
> Is this planned to be fixed in the new module system?
Yes.