This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
New environment/module patches
- To: Jost Boekemeier <jostobfe at calvados dot zrz dot TU-Berlin dot DE>
- Subject: New environment/module patches
- From: thi <ttn at mingle dot glug dot org>
- Date: Thu, 25 Nov 1999 05:03:16 -0800 (PST)
- Cc: guile at sourceware dot cygnus dot com
- References: <199911251136.LAA32534@linux.zrz.TU-Berlin.DE>
- Reply-To: ttn at netcom dot com
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