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: About modules



> Am I correct in thinking that the environments interface (as specified
> by Jim and implemented by Jost) provides what you describe here -
> i.e. a mechanism for managing names?  If not, what is missing and/or
> superfluous?

The environments aren't everything you need --- they'd be really
clumsy to use directly.  environments are to modules as pairs are to
lists.

> It seems to me that environments do provide the required mechanism,
> except perhaps that they are more complex than we need.  To implement
> the type of module system described by Jonathan Rees, for example, all
> we need is a single environment type, in which the entry for a
> particular name can hold, in addition to its vcell, a pointer to an
> entry in another environment.  We still need an observer mechanism,
> but per-entry rather than per-environment.

You may be entirely correct that the environments are too complex.  I
don't know.

A lot of that complexity is there to handle the case where you edit
and re-load a module.  I think this is something that people will
often do while developing.  In this situation, bindings will
arbitrarily appear, change, and disappear.  It seems fragile to have
to announce each binding change individually; the code to track that
seems more complex and error-prone than my proposal.  But that's just
an intuition; I'd be interested in seeing evidence otherwise.

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