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: Where should guile modules store meta data?


Jost Boekemeier <jostobfe@calvados.zrz.TU-Berlin.DE> writes:

> 
> > Also, with a two file system it seems like you will force a tight
> > binding between files and modules. 
> 
> Yes. This is neccesary.
> 

Why ? When you read (not load) a module definition from file, couldn't you
split the input at define-module froms, evaluate the define-module in the
config-environment (is that the right name ?),  switch to the module
environment and eval the rest ? Is the problem that right now you want to
load (i.e. read and eval) the module files rather than reading them,
manipulating the lists you just read and then evaluate parts carefully in
various environments ?

> 
> > Why aren't modules and files orthogonal concepts.
> 
> A module *is* a file with an interface.  It seems to me that when you
> are talking about modules, you really mean a different concept: name
> spaces or "environments".
> 

In a way, modules are several environments bundled together; I think
define-module's job should be to provide a convenient notation for dealing
with three environments at once: the public interface, the private
implementation environment and the import environment. But modules and
files have to be orthogonal concepts --- if you require a one-to-one (or
two-to-one) association between files and modules, it would, for example,
be impossible to write nested modules or several modules in a single file.

One weakness of the current module system is that the notation does not
delimit the extent of a define-module, but rather knows when one
define-module is done by the fact that (a) another define-module starts or
(b) an end-of-file is encountered. This muddles the distinction between
files and modules. I wouldn't mind a notation where the implementation of
the module is contained inside the define-module form, just as it is for
ordinary define's; it would be a lot cleaner.

But whichever way, you're doing really cool stuff :) This is a major leap
forward for guile,
David

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