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:

> 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.

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