EnvironmentRedirect behaves like an Environment that redirects access (put(key, val), or ~key) and assignment (at(key), or ~key = val). It is used as a basis for classes like LazyEnvir and ProxySpace.
Create new environment redirect, if envir is passed, it is used as a basis.
EnvironmentRedirect implements some of the interface of Environment
return or replace the source environment
Overriding these methods, one can redirect where objects go when they are assigned to the space. This is done for example in LazyEnvir and ProxySpace.
Links the environment to the current document, so that it is the currentEnvironment only when one document is in focus. See: Document: -envir
| doc |
The document to link to, defaults to the current document (Document: *current). If the document has focus or no document is given, the environment is pushed immediately. |
Uninks the environment to the current document, so that it is the currentEnvironment only when one document is in focus. See: Document: -envir
| doc |
The document to unlink from, defaults to the current document (Document: *current). If the document has focus or no document is given, the environment is popped immediately. |
A function or object that is called when the environment is modified. The key and the changed object are passed as arguments. When an object is removed from the environment, dispatch is called with its key and nil. Note that dispatch is called on removal only if the removed object existed.
EnvironmentRedirect implements some of the interface of Environment, which it can replace where needed.
EnvironmentRedirect and its subclasses can be used to dispatch assignment, e.g. over a network. To do this, a dispatch function can be supplied - see Public in JITLibExtensions quark. The following local methods can be used to avoid a recursive updating:
Like put, but without calling the dispatch function.
Like removeAt, but without calling the dispatch function.