Delegates: Difference between revisions
→{{header|Oforth}}
Line 1,345:
=={{header|Oforth}}==
<lang Oforth>Object Class new: Delegate1
Object Class new: Delegate2
Delegate2 method: thing
Object Class new: Delegator(delegate)
Delegator method: initialize
Delegator method: operation
@delegate respondTo(#thing) ifTrue: [ @delegate thing return ]
"Default implementation" println ;</lang>
Usage :
|