]> gitweb.factorcode.org Git - factor.git/commitdiff
spread>quot now outputs empty quotations where you would expect so that things like...
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 19 Sep 2011 04:23:53 +0000 (23:23 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 19 Sep 2011 04:23:53 +0000 (23:23 -0500)
Fixes #139

core/combinators/combinators-tests.factor
core/combinators/combinators.factor

index 97de07d54668a51e8631c0a8f5c233ef1b3fe791..3a8cc23811913b199ae005021b6a31d46421daff 100644 (file)
@@ -1,6 +1,6 @@
 USING: alien strings kernel math tools.test io prettyprint
 namespaces combinators words classes sequences accessors
-math.functions arrays combinators.private ;
+math.functions arrays combinators.private stack-checker ;
 IN: combinators.tests
 
 [ 3 ] [ 1 2 [ + ] call( x y -- z ) ] unit-test
@@ -320,3 +320,7 @@ DEFER: corner-case-1
 
 [ "nachos" ] [ 33 test-case-12 ] unit-test
 [ "nachos" ] [ 33 \ test-case-12 def>> call ] unit-test
+
+! Fixes #138
+[ { 3 3 } ]
+[ [ { [ ] [ ] [ ] } spread ] [ inputs ] [ outputs ] bi 2array ] unit-test
\ No newline at end of file
index fc259afbaf57ffd0ac5d53bb17f62317096da5ec..ace9b47aa1139c3d26cb16f7598b743829fabf1a 100644 (file)
@@ -66,7 +66,7 @@ SLOT: terminated?
 
 ! spread
 : spread>quot ( seq -- quot )
-    [ ] [ [ dup empty? [ [ dip ] curry ] unless ] dip append ] reduce ;
+    [ ] [ [ [ dip ] curry ] dip append ] reduce ;
 
 : spread ( objs... seq -- )
     spread>quot call ;