This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: nested modules / anonymous modules
- To: jostobfe at linux dot zrz dot TU-Berlin dot DE
- Subject: Re: nested modules / anonymous modules
- From: Clark McGrew <mcgrew at ale dot physics dot sunysb dot edu>
- Date: Mon, 18 Oct 1999 13:27:03 -0400 (EDT)
- CC: djurfeldt at nada dot kth dot se, craig at red-bean dot com,Klaus dot Schilling at home dot ivm dot de, mvo at zagadka dot ping dot de,guile at sourceware dot cygnus dot com, djurfeldt at nada dot kth dot se
- References: <199909131751.RAA12898@linux.zrz.TU-Berlin.DE> <xy7671ee89x.fsf@mdj-pc.nada.kth.se> <oflna9sxyo.fsf@chl.tbit.dk> <xy7k8pty0l3.fsf@mdj-pc.nada.kth.se> <m2ogf5mqkm.fsf@magnus.bothner.com> <xy7iu5ds8w9.fsf@mdj-pc.nada.kth.se> <xy77llng8t7.fsf@thalamus.nada.kth.se> <879063lowi.fsf@zagadka.ping.de> <m11ShfH-000H40C@debian> <87n1uiswly.fsf@sanpietro.red-bean.com> <xy73dwaladu.fsf@thalamus.nada.kth.se> <87k8plqvcq.fsf@sanpietro.red-bean.com> <xy7ogevahq9.fsf@thalamus.nada.kth.se> <199910152151.VAA06072@linux.zrz.TU-Berlin.DE>
- Reply-to: clark dot mcgrew at sunysb dot edu
Hello,
Is there any spec for the proposed module system? All I've ever seen
is Jim Blandy's low level environment spec.
How does the proposed module system compare to other systems (eg
Rscheme, MIT Scheme, Blume's, Tung's, Lee and Friedman's, Curtis and
Rauen's, Bigloo, &c)? Scheme module systems have existed for years so
there is not need for guile to re-invent old ideas.
>>>>> "Jost" == Jost Boekemeier <jostobfe@linux.zrz.TU-Berlin.DE> writes:
I lost the reference, but I think the reply was to Mikael Djurfeldt:
Jost> 2. Modules are independent from each other but may access
Jost> each other's features.
Jost> ;; within the `the-module' (define-module (ice-9 test)) ;;
Jost> equal to: (set! the-module (make-new-module ice-9 test)) ;;
Jost> evaluate expressions in the-module (define x 99)
Jost> (define-module (ice-9 test2) :use-module (ice-9 test)) ...
Jost> This solution uses a single global variable to switch from
Jost> one module to another. Which means that only one module at
Jost> a time can exist.
Can you explain this? I don't understand what you mean. In what
sense can only one module exist at a time? That seems to be an
implicit assumption in all of your examples.
Jost> 4. One file -- one module
This has the advantage of being C-like so it's easy for C-philes to
grok.
Jost> Although it is possible to byte compile the file ice-9/test2
Jost> so that the module loader will automatically load the
Jost> compiled module in favour of ice-9/test2.scm it is not
Jost> possible to define more than one module per file.
Why? I don't see any problem with compiling a file which contains
more than one module. I would think that the problem comes when you
need to find a module since the obvious module->file mapping is lost.
That can be solved (without a global mapping file) by having a default
mapping [(ice-9 boot-9)->ice-9/boot-9.scm] and an extended
"use-modules".
eg.
(use-modules
(app mod1)
(app mod2) :from "app/modlib.scm")
Where (app mod1) would be in app/mod1.scm, and (app mod2) would be
found in "app/modlib.scm" (along with any number of other modules).
Cheers,
Clark