[plt-scheme] How to deal with namespace in embed mode?

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Sun Jun 1 06:13:48 EDT 2008


Chiyuan Zhang wrote:
> Hi all,
>
> I sent a mail to the list but it seems that non-member can't do this.
> So I subscribed to this list and ask again.
>
> I was embedding mzscheme and I sometimes need multiple independent
> namespaces. The document on namespace of "Inside PLT MzScheme" is
> rather brief. But I found that it seems "make_namespace" can be used
> to create a Scheme_Env * which can be used as a namespace.
>
>   
Yes, this is correct.

> It can be passed to the functions like scheme_eval as the namespace to
> use. However, I found another paragraph in "PLT MzScheme: Language
> reference":
>
>   A namespace is used by setting the current-namespace parameter value
>   (see section 7.9.1.5), by providing the namespace to procedures such
>   as eval and eval-syntax.
>
> So is it enough by just passing the namespace to the functions? Or
> should I set the current-namespace parameter each time I switched to
> another namespace?
>
>   

You can do either. (Assuming you are using PLT Scheme v372,) Please 
refer to chapter 4 and 9 about the current-namespace parameter.

> Thanks for help!
>   
Chongkai


Posted on the users mailing list.