<!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>Hi Wayne</DIV>
<DIV>Is this what you want?</DIV>
<DIV> </DIV>
<DIV>(module lang1 mzscheme<BR> (provide
(all-defined)<BR>
(all-from mzscheme))<BR> (define f 1))</DIV>
<DIV> </DIV>
<DIV>(module test1 lang1<BR> (provide (all-defined))<BR> (define
(test1)<BR> (printf "~s~n"</DIV>
<DIV> (namespace-variable-value 'f #t (lambda ()
'undefined)</DIV>
<DIV> (module->namespace 'lang1)))))</DIV>
<DIV> </DIV>
<DIV>(require test1)<BR>(test1) ; display 1</DIV>
<DIV> </DIV>
<DIV>(module lang2 mzscheme (provide (all-from mzscheme)))</DIV>
<DIV> </DIV>
<DIV>(module test2 lang2<BR> (provide (all-defined))<BR> (define
(test2)<BR> (printf "~s~n" </DIV>
<DIV> (namespace-variable-value 'f #t (lambda ()
'undefined)</DIV>
<DIV> (module->namespace 'lang2)))))</DIV>
<DIV> </DIV>
<DIV>(require test2)<BR>(test2) ; --> display undefined</DIV>
<DIV> </DIV>
<DIV>Jos</DIV>
<DIV> </DIV>
<DIV>((((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"))))</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:37
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [plt-scheme]
namespace-variable-value</DIV>
<DIV><BR></DIV>
<DIV>Jos,<BR><BR>On Fri, Apr 27, 2007 at 07:30:26PM +0200, jos koot
wrote:<BR>> 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
<BR>> the module cannot corrupt the variables.<BR><BR>It's not clear to me
whether this answers the question I'm trying to ask. Here's<BR>the
original code:<BR><BR>(module lang mzscheme<BR> (provide
(all-defined)<BR>
(all-from mzscheme))<BR> (define f 1))<BR><BR>(module test
lang<BR> (provide (all-defined))</DIV>
<DIV> (provide (all-from lang)<BR> (define
(test1)<BR> (display (namespace-variable-value
'f))))<BR><BR>(require test)<BR>(test1)<BR><BR>I don't want to set a
module-level variable outside of the module, I want<BR>to test whether it has
been defined. I expected the namespace-variable-value<BR>call to use
mapping (the default) to see that f has been imported. Am
I<BR>misunderstanding how namespace-variable-value
works?<BR><BR>Wayne<BR></DIV></BLOCKQUOTE></BODY></HTML>