Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,14 @@
/** Guard accepting only objects with an 'eat' method */
def Eatable {
to coerce(specimen, ejector) {
if (Ref.isNear(specimen) && specimen.__respondsTo("eat", 0)) {
return specimen
} else {
throw.eject(ejector, `inedible: $specimen`)
}
}
}
def makeFoodBox() {
return [].diverge(Eatable) # A guard-constrained list
}