Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
22
Task/Delegates/Io/delegates.io
Normal file
22
Task/Delegates/Io/delegates.io
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
Delegator := Object clone do(
|
||||
delegate ::= nil
|
||||
operation := method(
|
||||
if((delegate != nil) and (delegate hasSlot("thing")),
|
||||
delegate thing,
|
||||
"default implementation"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Delegate := Object clone do(
|
||||
thing := method("delegate implementation")
|
||||
)
|
||||
|
||||
a := clone Delegator
|
||||
a operation println
|
||||
|
||||
a setDelegate("A delegate may be any object")
|
||||
a operation println
|
||||
|
||||
a setDelegate(Delegate clone)
|
||||
a operation println
|
||||
Loading…
Add table
Add a link
Reference in a new issue