EnvironmentRedirect:
Filter:

EnvironmentRedirect : Object

Base class for environment redirects.
Subclasses: LazyEnvir

Description

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 base class for redirecting Environments. For example uses, see LazyEnvir and ProxySpace.

Class Methods

EnvironmentRedirect.new(envir)

Create new environment redirect, if envir is passed, it is used as a basis.

replacing Environment class methods

EnvironmentRedirect implements some of the interface of Environment

EnvironmentRedirect.push

EnvironmentRedirect.pop

EnvironmentRedirect.make(function)

EnvironmentRedirect.use(function)

EnvironmentRedirect.newFrom(aCollection)

Inherited class methods

Instance Methods

.envir

.envir = argEnvir

return or replace the source environment

redirecting objects

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.

.at(key)

.put(key, obj)

.removeAt(key)

.add(anAssociation)

.linkDoc(doc)

.unlinkDoc(doc)

.dispatch

.dispatch = disp

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.

Behaving like an Environment

EnvironmentRedirect implements some of the interface of Environment, which it can replace where needed.

.push

.pop

.clear

.choose

.make(function)

.use(function)

.do(function)

.keysValuesDo(function)

.sortedKeysValuesDo(function)

.putAll( ... dictionaries)

.keysValuesArrayDo(argArray, function)

.doFunctionPerform(selector, args)

.keys(species)

.values

.findKeyForValue(val)

.know

.know = flag

.doesNotUnderstand(selector ... args)

Networking and forwarding assignment

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:

.localPut(key, obj)

Like put, but without calling the dispatch function.

.localRemoveAt(key)

Like removeAt, but without calling the dispatch function.

Inherited instance methods