// example tck programs (work with tck1, tck2, tck3) / transitive closure: [3 3] [0 0 0 1] # [dup dup [& [|] over] right |] converge e(3 3;0 0 0 1;#;(dup;dup;(&;,(|);over);right;|);converge) M:d[(3 3;0 0 0 1;#)] tc:d[((dup;dup;(&;,(|);over);right;|);converge)] e M,tc e`M`tc / accumulator generator: [3 gen 10 swap i 12 swap i] = e(3;gen;10;swap;i;12;swap;i) acc:d[((+;`acc);cons)] / e((3;`acc;i);10;swap;i) -> ,(13;+;`acc) -> &c. foo:d[(`acc`i;cons)] / e(3;foo) -> ,(3;`acc;`i) / quine: [[dup cons] dup cons] quine:d[(`dup`cons;`dup;`cons)] / e(quine;i) -> ,quine / factorial: [null] [succ] [dup pred] [*] linrec fact:d[((0;=);(1;+);(dup;-1;+);,(*);linrec)] / conditional test:d[((((0;=);,10) ((1;=);,20) ,30);cond)] / infinite/circular lists thing:d[,(10;20;`thing)] e(thing;2;@;i) \ From Raul Miller, on the K listbox: {[M]M|{|/M&x}'M}/ / the inner lambda is a closure elimination of variables: -> {[M]M|M{|/x&y}/:M}/ / lift M from inner lambda -> {[M]M|M(|/&)/:M}/ / convert inner lambda to a composition 2a2 prefix: or:| and:& over:{x/y} converge:{x/y} right:{y x/:z} tc:converge[{or[x]right[{over[or]and[x]y}][x]x}]