<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>Module level variables can be assigned to only by the module itself. In
this way the writer of a module is assured that the user of the module cannot
corrupt the variables.</DIV>
<DIV>Matthias Felleisen already suggested to use boxes in stead of
variables:</DIV>
<DIV> </DIV>
<DIV>(module lang mzscheme<BR> (provide f)<BR> (define f (box
'who-cares?)))<BR> <BR>(module test mzscheme<BR> (require
lang)<BR> (set-box! f 1)<BR> (provide test1)<BR> (define
(test1) (unbox f)))<BR> <BR>(require test)<BR>(test1) ; --> 1</DIV>
<DIV> </DIV>
<DIV>Jos</DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>(((((lambda(x)((((((((x
x)x)x)x)x)x)x)x))<BR> (lambda(x)(lambda(y)(x(x
y)))))<BR> (lambda(x)(x)x))<BR> (lambda()(printf "Greetings,
Jos~n"))))</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=support@taxupdate.com
href="mailto:support@taxupdate.com">support@taxupdate.com</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=jos.koot@telefonica.net
href="mailto:jos.koot@telefonica.net">jos koot</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=plt-scheme@list.cs.brown.edu
href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, April 27, 2007 2:09
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [plt-scheme]
namespace-variable-value</DIV>
<DIV><BR></DIV><BR>On Fri, Apr 27, 2007 at 06:41:34PM +0200, jos koot
wrote:<BR><BR>> (module lang mzscheme<BR>> (printf
"defining~n")<BR>> (namespace-set-variable-value! 'f
1))<BR>> <BR>> (module test mzscheme<BR>> (require lang)
; does the top level assignment (once only)<BR>> (provide
(all-defined))<BR>> (define (test1) (namespace-variable-value
'f))) ; refers to the top level<BR>> <BR>> (require test) ;; prints
defining<BR>> (test1) ;; -->
1<BR>> (require lang) ;; does nothing<BR><BR>I'm hoping to set module-level
variables, not top-level. My understanding<BR>of the docs leads me to
believe that namespace-variable-value can use<BR>mapping to return imported
variable mappings.<BR><BR>Wayne<BR></BLOCKQUOTE></BODY></HTML>