]> gitweb.factorcode.org Git - factor.git/commitdiff
infix: using "if-empty" makes it cleaner.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 22 Sep 2011 02:31:26 +0000 (19:31 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 22 Sep 2011 02:31:26 +0000 (19:31 -0700)
extra/infix/infix.factor

index 1945b2e9065080a654120271c42459ac1f3d8f28..2cfdbf10808b4874956e4eb1ae84489db6c58359 100644 (file)
@@ -82,10 +82,10 @@ M: bad-stack-effect summary
     [ 1quotation compose ] [ bad-stack-effect ] if ;
 
 : arguments-codegen ( seq -- quot )
-    dup empty? [ drop [ ] ] [
+    [ [ ] ] [
         [ infix-codegen prepare-operand ]
         [ compose ] map-reduce
-    ] if ;
+    ] if-empty ;
 
 M: ast-function infix-codegen
     [ arguments>> [ arguments-codegen ] [ length ] bi ]