19 lines
652 B
Plaintext
19 lines
652 B
Plaintext
n:=3;
|
|
n.pump(List) //-->L(0,1,2)
|
|
|
|
n.pump(List,List) //-->L(0,1,2), not expected
|
|
because the second list can be used to describe a calculation
|
|
n.pump(List,List(Void,List)) //--> L(L(),L(),L()) all same
|
|
List(Void,List) means returns List, which is a "known" value
|
|
n.pump(List,List.fpM("-")) //--> L(L(),L(),L()) all distinct
|
|
fpM is partial application: call List.create()
|
|
|
|
n.pump(List,(0.0).random.fp(1)) //--> 3 [0,1) randoms
|
|
L(0.902645,0.799657,0.0753809)
|
|
|
|
n.pump(String) //-->"012", default action is id function
|
|
|
|
class C{ var n; fcn init(x){n=x} }
|
|
n.pump(List,C) //--> L(C,C,C)
|
|
n.pump(List,C).apply("n") //-->L(0,1,2) ie all classes distinct
|