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: nested modules / anonymous modules


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

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