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: Testing dangerous change in tomorrow's snapshot (was: Re: Guile segv)



> > It's good to have a (guile-repl) with repl-related things defined in
> > it and the contents of the (guile) module re-exported, but I still
> > don't think the name of the user module should cconatin `repl'. It
> > should just be a module that uses all the modules a user may want and
> > starts with no other bindings. This will probably include the
> > guile-repl module. A user is free to define another module for his own
> > use if the default imports of the user module are inconvenient.
> 
> I agree.
> 
> I made the above change late last night, and in the morning a woke up
> with the feeling that I had made a mistake.  :)

Gentleman, you are both dead wrong.  :)

There should be a module named (guile-user).  It should contain, by
definition, the bindings we want to have present at the prompt by
default - R4RS, plus the usual stew.  It should not, in normal
practice, be modified.

There should also be a module named (interaction).  It should import
(guile-user), and nothing else.  Definitions which the user types at
the prompt should go into (interaction), perhaps shadowing those in
(guile-user).  If, in the future, we have a single Guile serving
multiple independent repls simultaneously, each repl will get its own
module, named (interaction-1), (interaction-2), etc. so that
definitions in one don't disturb the other.

However, Guile system code should not import (interaction), nor should
it import (guile-user).  It should import functions directly from the
modules they originate in, because that means that the imports
accurately describe what the modules use.

Thus, the problems with redefining VARIABLE? will not arise, because
the Guile system code referring to VARIABLE will be importing it
directly, and not depending on (interaction).  The user can wipe out
every binding except LAMBDA, for example, and the repl, the
error-handling stuff, etc. will still work.


I hope that makes all this clear.  I hope it makes it especially clear
that I WAS RIGHT ALL ALONG.  SO THERE.

:)

(Just kidding; the above is what I had in mind, but did not really
explain, and I'm quite interested in comments.)