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]

New environment/module patches


Jost Boekemeier writes:

 > * The semantics of the module's public- and export-environment have changed.
 >   The module's public-environment now exports symbols from the module's
 >   export-environment which in turn exports symbols from the module's
 >   eval-environment.  Which means:
 > 
 >   (module (my module)
 >           (open (ice-9 root))
 > 	  (export a b c internal)
 >           (public a b c))
 > 
 >    makes the symbols `a', `b' and `c' available to all modules while
 >    `internal' is hidden within the package `my'.

this is confusing to me; i tend to think of "export" and "public"
synonymously.  why not use "evalable" or something like that instead of
"export"?

 > * New macro: (module-close <modname>) *marks* a module as beeing closed.  This
 >   module will disappear as soon as it is no longer referenced:
 > 
 >      user/guile> (define-module (my test))   
 >      my/test> (define a 12)
 >      my/test> a
 >      12
 >      my/test> (module-close (my test))
 >      my/test> a
 >      12
 >      my/test> (define-module (my test))
 >      my/test> a
 >      ERROR: Unbound variable: a
 >      ABORT: (misc-error)

i'm curious as to how the following sequence would work:

(define-module (my test))
(define a 12)
(define-module (user))
(define (answer) (module-ref (resolve-module '(my test)) 'a)) ; or equivalent
(module-close (my test))
(define-module (user))	; perhaps not required
(answer)

from your example, it looks like `define-module' examines the
closed-module mark.  who else does this?

thi

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