Delegates: Difference between revisions
Content deleted Content added
Line 1,129: | Line 1,129: | ||
Delegator method: initialize { := delegate } |
Delegator method: initialize { := delegate } |
||
Delegator method: |
Delegator method: operation |
||
{ |
{ |
||
@delegate respondTo(#thing) ifTrue: [ @delegate thing return ] |
@delegate respondTo(#thing) ifTrue: [ @delegate thing return ] |
||
Line 1,136: | Line 1,136: | ||
Usage : |
Usage : |
||
<lang Oforth>Delegator new(null) |
<lang Oforth>Delegator new(null) operation |
||
Default implementation |
Default implementation |
||
Delegator new(Delegate1 new) |
Delegator new(Delegate1 new) operation |
||
Default implementation |
Default implementation |
||
Delegator new(Delegate2 new) |
Delegator new(Delegate2 new) operation |
||
Delegate implementation</lang> |
Delegate implementation</lang> |
||