Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Constrained-genericity/Zkl/constrained-genericity-1.zkl
Normal file
10
Task/Constrained-genericity/Zkl/constrained-genericity-1.zkl
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class Eatable{ var v;
|
||||
fcn eat{ println("munching ",self.topdog.name); }
|
||||
}
|
||||
class FoodBox{
|
||||
fcn init(food1,food2,etc){
|
||||
editable,garbage:=vm.arglist.filter22("isChildOf",Eatable);
|
||||
var contents=editable;
|
||||
if(garbage) println("Rejecting: ",garbage);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
class Apple(Eatable){} class Nuts(Eatable){} class Foo{}
|
||||
FoodBox(Apple,"boogers",Nuts,Foo).contents.apply2("eat");
|
||||
Loading…
Add table
Add a link
Reference in a new issue