[plt-scheme] namespaces

From: Ivanyi Peter (pivanyi at freemail.hu)
Date: Fri Jul 28 06:11:40 EDT 2006


Forget my previous e-mail about the top-level transformer
I have realised that I have to handle namespaces. I came up
with the
following code, which I "stole" from DrScheme.

(define nn 
  (let ([ns (null-environment 5)])
	(parameterize ([current-namespace ns])
          (namespace-require '(file "my-module.scm"))
(current-namespace nn)

In my module I have overwritten the #%top and #%app macros and
I have a couple other macros. If I list them with
(namespace-mapped-symbols nn), they are there and it looks fine.
When I execute any of my functions, they work, but when they
they generate an error message, and every time a different one!!
For example in DrScheme:

> (current-namespace nn)
> w
dynamic-require: unknown module: #%mred-kernel
> (+ 2 3)
reference to an identifier before its definition: cursor%
> (setq e 3)
reference to an identifier before its definition: menu-item%
> (print e)

Interestingly printing does not generate this error. 
Can someone tell what is the problem? How can I correct this 


Peter Ivanyi

Nyári slágerek a T-Online Zeneáruházban!  http://zenearuhaz.t-online.hu

Posted on the users mailing list.