[plt-scheme] Getting at a module's namespace

From: Ed Cavazos (proteus at theworld.com)
Date: Wed Apr 23 08:25:32 EDT 2003

 From what I gather of Scheme48's modules, it's possible to operate
inside the namespace of one from the REPL:

       http://www.s48.org/0.57/manual/s48manual_32.html

Is there any way to require a module, and then evaluate expressions
inside it's namespace? "src/module.c" says that modules are basically
implemented as namespaces, so if I could get at the namespaces that
corresponds to an invoked module, I could just do something like:

	    (require (lib "foo.scm" "foomod"))
	    
	    (eval '(set! *blah* 10) (module-namespace foo))

or even:
            (eval '(read-eval-print-loop) (module-namespace foo))

To interact with a namespace.

I think this is the "right thing" in my situation, but considered it
unholy till I saw Rees and Kelsey doin it. ;-)

Ed



Posted on the users mailing list.