This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: Where should guile modules store meta data?
- To: jostobfe@calvados.zrz.TU-Berlin.DE
- Subject: Re: Where should guile modules store meta data?
- From: Clark McGrew <mcgrew@ale.physics.sunysb.edu>
- Date: Sat, 5 Jun 1999 16:17:07 +0900 (JST)
- CC: mpriz@dircon.co.uk, guile@cygnus.com
- References: <007801beae1c$02815420$923670c2@mpriz.dircon.co.uk> <p2tbtewmg67.fsf@walnuss.zrz.tu-berlin.de>
- Reply-to: clark.mcgrew@sunysb.edu
Hello,
Jost> Yes, I think we should split the module into two separate
Jost> files. An interface file which holds scheme code that
Jost> defines the module's interface:
Are you intending to force a two file configuration, or just support
it. I like the idea that modules *can* be split into separate files,
but for an interactive system it's much better to have the module all
in one place.
For example, here is how I use guile:
I work with detectors that have large sets of data, and we continually
develop new algorithms. Guile provides an interactive development
enviroment, and is used as a data browser. We have a large code base,
so without a module system there are problems with namespace
collisions and all we need is a crude module system that provides
simple namespace separation. The current module system has the
advantage that it is very easy to add new modules. A user can pretty
much forget about the rest of the system, and hack away. Then it's a
simple matter of slapping a define-module and export into the file.
After a few days of playing with the new module it is often resigned
to the trash heap.
Also, with a two file system it seems like you will force a tight
binding between files and modules. Why aren't modules and files
orthogonal concepts. There are many situations where it is extremely
convenient to define several modules within a single file. There are
situations where it's convenient to define a single module in several
files.
Jost> (module-define
Jost> '(ice-9 test1)
Jost> '((system root))
Jost> '((a mutable-location) (b immutable-location))
Jost '()
Jost> '(begin (define a 1) (define (b) (display a))))
Jost> (display "loading definitions for ice-9/test1\n")
Jost> (module-load-definitions 'ice-9/test1)
[Sorry I reindented. I accidentally mangled it.]
Jost> Note that this is a two-step process: 1. load and execute
Jost> the interface which in turn is responsible to 2. load and
Jost> execute the definitions.
It might be nice to have two files when you are developing a large
package for something like emacs, but that would be a serious pain in
the neck for simple module users. Frankly the interface you've
descibed is so heavy that we would probably revert to the old scheme
'load' and enforce namespace separation with prefixes. That is a
giant step backwards.
I'm a natural pessimist, so the real situation probably isn't so
bad. But, please make sure that the new system is simple to use, as
well as powerful.
Thanks,
Clark