OSDN Git Service

Elegant definitions for un-, bin-, tern-ary combinators.
authorSimon Forman <sforman@hushmail.com>
Wed, 13 Jun 2018 17:24:36 +0000 (10:24 -0700)
committerSimon Forman <sforman@hushmail.com>
Wed, 13 Jun 2018 17:24:36 +0000 (10:24 -0700)
joy/library.py

index 0bafed9..f754093 100644 (file)
@@ -103,9 +103,9 @@ disenstacken == ? [uncons ?] loop pop
 ? == dup truthy
 dinfrirst == dip infra first
 nullary == [stack] dinfrirst
-unary == [stack [pop] dip] dinfrirst
-binary == [stack [popop] dip] dinfrirst
-ternary == [stack [popop pop] dip] dinfrirst
+unary == nullary popd
+binary == nullary [popop] dip
+ternary == unary [popop] dip
 pam == [i] map
 run == [] swap infra
 sqr == dup mul