[plt-scheme] namespace-variable-value

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

Jos,

On Fri, Apr 27, 2007 at 07:30:26PM +0200, jos koot wrote:
> 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.

It's not clear to me whether this answers the question I'm trying to ask.  Here's
the original code:

(module lang mzscheme
  (provide (all-defined)
           (all-from mzscheme))
  (define f 1))

(module test lang
  (provide (all-defined))
  (define (test1)
    (display (namespace-variable-value 'f))))

(require test)
(test1)

I don't want to set a module-level variable outside of the module, I want
to test whether it has been defined.  I expected the namespace-variable-value
call to use mapping (the default) to see that f has been imported.  Am I
misunderstanding how namespace-variable-value works?

Wayne


Posted on the users mailing list.