Resends
|
Resends
Self has a resend mechanism, using the keyword resend. This enables an
overriding method to invoke the overridden method.
The syntax used is to attach the message selector to resend with a period, e.g.:
at: key = (resend.at: hash: key)
This example defines a method at: which invokes an overridden version of at:,
passing it the hash of its argument.
When an object has multiple parents, a directed resend can be used to
disambiguate conflicting inherited slots. In this case resend is replaced by the name
of the parent slot:
(|
parent1* = (| foo = 3 |).
parent2* = (| foo = 4 |).
foo = (parent1.foo + parent2.foo)
|)
|