[plt-scheme] namespaces
Hi,
Forget my previous e-mail about the top-level transformer
environment.
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"))
)
ns))
(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
return
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)
3
>
Interestingly printing does not generate this error.
Can someone tell what is the problem? How can I correct this
behaviour?
Thanks,
Peter Ivanyi
_____________________________________________________________________
Nyári slágerek a T-Online Zeneáruházban! http://zenearuhaz.t-online.hu