Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
11
Task/Delegates/Oforth/delegates-1.oforth
Normal file
11
Task/Delegates/Oforth/delegates-1.oforth
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
Object Class new: Delegate1
|
||||
|
||||
Object Class new: Delegate2
|
||||
Delegate2 method: thing "Delegate implementation" println ;
|
||||
|
||||
Object Class new: Delegator(delegate)
|
||||
Delegator method: initialize := delegate ;
|
||||
|
||||
Delegator method: operation
|
||||
@delegate respondTo(#thing) ifTrue: [ @delegate thing return ]
|
||||
"Default implementation" println ;
|
||||
8
Task/Delegates/Oforth/delegates-2.oforth
Normal file
8
Task/Delegates/Oforth/delegates-2.oforth
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
Delegator new(null) operation
|
||||
Default implementation
|
||||
|
||||
Delegator new(Delegate1 new) operation
|
||||
Default implementation
|
||||
|
||||
Delegator new(Delegate2 new) operation
|
||||
Delegate implementation
|
||||
Loading…
Add table
Add a link
Reference in a new issue