Jump to content

Delegates: Difference between revisions

Line 2,425:
{{works with|Smalltalk/X}}
Definition of the thingy:
<lang smalltalk>Object
Object
subclass:#Thingy
instanceVariableNames:''
Line 2,433 ⟶ 2,432:
^ 'thingy implementation'</lang>
Definition of the delegator:
<lang smalltalk>Object
Object
subclass:#Delegator
instanceVariableNames:'delegate'
Line 2,446 ⟶ 2,444:
ifNotUnderstood:'default implementation'.</lang>
Sample use:
<lang smalltalk> |d|
|d|
d := Delegator new.
d operation.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.