Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
23
Task/Inheritance-Multiple/E/inheritance-multiple-1.e
Normal file
23
Task/Inheritance-Multiple/E/inheritance-multiple-1.e
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
def minherit(self, supers) {
|
||||
def forwarder match [verb, args] {
|
||||
escape __return {
|
||||
if (verb == "__respondsTo") {
|
||||
def [verb, arity] := args
|
||||
for super ? (super.__respondsTo(verb, arity)) in supers {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
} else if (verb == "__getAllegedType") {
|
||||
# XXX not a complete implementation
|
||||
return supers[0].__getAllegedType()
|
||||
} else {
|
||||
def arity := args.size()
|
||||
for super ? (super.__respondsTo(verb, arity)) in supers {
|
||||
return E.call(super, verb, args)
|
||||
}
|
||||
throw(`No parent of $self responds to $verb/$arity`)
|
||||
}
|
||||
}
|
||||
}
|
||||
return forwarder
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue