i all the A langs
This commit is contained in:
parent
86c034bb8b
commit
9246b988c7
245 changed files with 3941 additions and 0 deletions
23
Task/Delegates/Aikido/delegates.aikido
Normal file
23
Task/Delegates/Aikido/delegates.aikido
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
class Delegator {
|
||||
public generic delegate = none
|
||||
|
||||
public function operation {
|
||||
if (typeof(delegate) == "none") {
|
||||
return "default implementation"
|
||||
}
|
||||
return delegate()
|
||||
}
|
||||
}
|
||||
|
||||
function thing {
|
||||
return "delegate implementation"
|
||||
}
|
||||
|
||||
// default, no delegate
|
||||
var d = new Delegator()
|
||||
println (d.operation())
|
||||
|
||||
// delegate
|
||||
var d1 = new Delegator()
|
||||
d1.delegate = thing
|
||||
println (d1.operation())
|
||||
Loading…
Add table
Add a link
Reference in a new issue