A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
18
Task/Inheritance-Single/E/inheritance-single-1.e
Normal file
18
Task/Inheritance-Single/E/inheritance-single-1.e
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
def makeType(label, superstamps) {
|
||||
def stamp {
|
||||
to audit(audition) {
|
||||
for s in superstamps { audition.ask(s) }
|
||||
return true
|
||||
}
|
||||
}
|
||||
def guard {
|
||||
to coerce(specimen, ejector) {
|
||||
if (__auditedBy(stamp, specimen)) {
|
||||
return specimen
|
||||
} else {
|
||||
throw.eject(ejector, `$specimen is not a $label`)
|
||||
}
|
||||
}
|
||||
}
|
||||
return [guard, stamp]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue