[plt-scheme] namespace-variable-value

From: support at taxupdate.com (support at taxupdate.com)
Date: Fri Apr 27 08:09:35 EDT 2007

On Fri, Apr 27, 2007 at 06:41:34PM +0200, jos koot wrote:

> (module lang mzscheme
>   (printf "defining~n")
>   (namespace-set-variable-value! 'f 1))
> 
> (module test mzscheme
>   (require lang) ; does the top level assignment (once only)
>   (provide (all-defined))
>   (define (test1) (namespace-variable-value 'f))) ; refers to the top level
> 
> (require test) ;; prints defining
> (test1)        ;; --> 1
> (require lang) ;; does nothing

I'm hoping to set module-level variables, not top-level.  My understanding
of the docs leads me to believe that namespace-variable-value can use
mapping to return imported variable mappings.

Wayne


Posted on the users mailing list.