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

Re: Scheme_make_namespace

Mikael Hansen <mhansen@cs.auc.dk> writes:

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

> 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.

Very interesting - I was contemplating sending an email outlining
pretty much the exact same situation, but didn't bother.  However, I
can attest that this very same scenario is exactly one of the problems
I have with some of the Apache Tcl code.

Creating a new request and then loading up code from seperate, on-disk
libraries would probably be workable, but it's slow.

Is it possible to export the code from one module and then import it
in the namespace without touching the disk?  I'm sorry for the lack of
MzScheme knowledge with which I ask this question...

Just out of curiousity, Mikael, do you have a URL that points to your
efforts?  Another suggestion might be to try and map the Apache API to
a scheme API (mod_rep does this, for instance), and then create a
'standard' module for doing server parsed pages or whatever else it is
your doing (but I'm guess it's that from the description of your

Close parenthesis... back to work,
David N. Welton
   Consulting: http://www.dedasys.com/
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/