[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Packaging, 2 last concerns
- From: Tomas <tomas@...>
- Date: Wed, 9 Jun 2004 22:18:43 -0300 (BRT)
> When you clone a namespace, the implementation still refers to the
> original namespace. If you make changes to the cloned namespace (such as
> changing a constant, or providing a new implementation for one of its
> functions), the library's implementation will not see the changes.
> Anyone has an obvious solution for this problem?
I don't think this is a problem...
We have a similar situation in CGILua 5.0 with some launchers
that persist with the server process (Apache module or FastCGI). These
launchers have to run one script per request in the same Lua state.
Therefore we have to protect the global environment from one execution
to another. The solution was to create a Virtual Environment which
inherits the globals from the original but kept any change inside it.
After the script execution, it is thrown away.
There is no "cloning", but inheritance. The changes you pointed
out will be restricted to the environment where they were made.