Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
25
Task/Delegates/EMal/delegates.emal
Normal file
25
Task/Delegates/EMal/delegates.emal
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
type Thingable
|
||||
interface
|
||||
fun thing ← text by block do end
|
||||
end
|
||||
type Delegate implements Thingable
|
||||
model
|
||||
fun thing ← text by block
|
||||
return "delegate implementation"
|
||||
end
|
||||
end
|
||||
type Delegator
|
||||
model
|
||||
Thingable delegate
|
||||
fun operation ← <|when(me.delegate æ null, "default implementation", me.delegate.thing())
|
||||
end
|
||||
fun byDelegate ← Delegator by Thingable delegate
|
||||
var delegator ← Delegator()
|
||||
delegator.delegate ← delegate
|
||||
return delegator
|
||||
end
|
||||
type Main
|
||||
Delegator a ← Delegator()
|
||||
writeLine(a.operation())
|
||||
Delegator b ← Delegator.byDelegate(Delegate())
|
||||
writeLine(b.operation())
|
||||
Loading…
Add table
Add a link
Reference in a new issue