SuperCollider CLASSES

EnvironmentRedirect

base class for environment redirects
Inherits from: Object
Subclasses: LazyEnvir

Description

Environment that redirects access (put) and assignment (at). It is used as a base class for redirecting Environments. For example uses, see LazyEnvir and ProxySpace.

Class Methods

*new (envir)

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

replacing Environment class methods

EnvironmentRedirect implements some of the interface of Environment

*push

*pop

*make (function)

*use (function)

Inherited class methods

Undocumented class methods

*newFrom (aCollection)

Instance Methods

-envir

-envir = argEnvir

return or replace the source environment

e = LazyEnvir.new;
e.put(\x, 9);
e.envir; // look into the envir itself: for a LazyEnvir it contains Maybe as placeholders

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)

-localPut (key, obj)

-removeAt (key)

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

e = LazyEnvir.new;
e.dispatch = { |key, val| [key, val].postln };
e.put(\x, 9);

replacing Environment instance methods

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

-push

-pop

-make (function)

-use (function)

-do (function)

-clear

-keysValuesDo (function)

-keysValuesArrayDo (argArray, function)

-findKeyForValue (val)

-sortedKeysValuesDo (function)

-choose

-know

-know = flag

-doesNotUnderstand (selector ... args)

Inherited instance methods

Undocumented instance methods

-add (anAssociation)

-doFunctionPerform (selector, args)

-linkDoc (doc, pushNow: true)

-putAll ( ... dictionaries)

-unlinkDoc (doc, popNow: false)

Networking

EnvironmentRedirect and its subclasses can be used to dispatch assignment over a network. To do this, a dispatch function can be supplied - see Public in JITLibExtensions quark.