[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scheme_make_namespace



Quoting Mikael Hansen:
> I am working with an embedded mzscheme. I create an env. with
> scheme_basic_env() and begin to load various libraries into this env. Now
> I need to make a copy of this env to be used for evaluations. Is this not
> a task for scheme_make_namespace() or will I loose the libraries already
> loaded by using this? As far as I can see I loose all the libraries loaded
> into it. Should I do something special? I can see that various arguments
> can be passed in the argv Scheme_Object, but which should be used to
> obtain the original env with the evaluations allready made in it?

Two possibilities:

 1. If you're using v200, then you can probably export from one module
    everything that you want to put into a namespace. Then it's just a
    matter of requiring the module in the newly created namespace
    (possibly attaching it first; see `namespace-attach-module').

 2. I could add support for a 'clone flag to `make-namespace'. I
    haven't done this yet because I haven't encountered a situation
    where option 1 wasn't better.

Matthew