BROADCAST:
Factor handbook > The language > Objects > Delegation

Prev:SLOT-PROTOCOL:
Next:CONSULT:


Vocabulary
delegate

Syntax
BROADCAST: group class code ;


Inputs and outputs
groupa protocol, generic word or tuple class
classa class
codecode to get the sequence of objects to all of which the method should be forwarded


Word description
Declares that objects of class will delegate the generic words contained in group to every object in the sequence returned by executing code with the original object as an input. BROADCAST: will overwrite any existing methods on class for the members of group, but new methods can be added after the BROADCAST: to override the delegation. Every generic word in group must return no outputs; otherwise, a broadcast-words-must-have-no-outputs error will be raised.

See also
define-consult, CONSULT:

Definition