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

Re: Scheme_make_namespace

Hi again

Well. I think the second option would be prefered. I better explain the

I have an Apache server with MzScheme embedded into it. At the startup of
the Apache process I initialize mzscheme with scheme_basic_env.  After
that I load libraries (represented by a number of .scm files) into the
environment. Then at the time of a request to the server I need to have a
new environment/namespace ready for evaluation of scheme files. After the
request I need to restore the original environment (the one with the
libraries loaded), to ensure that all requests are processed in the same
(clean) environment.

Currently I have done this by killing the apache child process after each
request. But a better solution is needed. That is why I considered the
scheme_make_namespace to create a copy of the original env, and somehow
place this copy in scheme_config as the current env. After the
request I would replace the just used env, with a copy of the original.

Does this seem as to far out an idea? I think Your second proposal sounds
like the only solution, at least as I understand the problem and Your
first proposal.

Best regards

On Tue, 5 Feb 2002, Matthew Flatt wrote:

> 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