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


Miroslav Silovic <silovic@zesoi.fer.hr> writes:

> Jost Boekemeier <jostobfe@calvados.zrz.TU-Berlin.DE> writes:
> 
> > 3. No global state variable and a "meta" module which describes the state
> > of all modules and carries their signatures.
> > 
> > ;; in the "meta" module (let's call it `config-module'):
> > 
> > (define some-value 1)
> > (define mod-signature1
> > 	(module (ice-9 test)
> > 		(open (ice-9 debug))
> > 		(export ...)
> > 		(begin 
> > 			(define a 12)
> > 			some-value ; -> error
> 
> 			^^^^^^^^^^^^^^^^^^^^^
> 
> This semantics breaks lexical scoping and is clearly unacceptable in
> Scheme.


Umm.  Why do you think that (eval ...) is not acceptable?



(module (root)
	(begin (define x 12)
		(module (sub1))
			(begin (define x (+ x 1))
			(module ...))))

>and please explain why it's the same as having no modules at all

When you open and extend the root module you implicitly open and
extend *all* modules.


Jost

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