]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/adsoda/combinators/combinators.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / extra / adsoda / combinators / combinators.factor
index 5838c30698967231605a000630f068fd727c4797..d00eebc9763497ba1bced13f7d38161774874bdc 100755 (executable)
@@ -4,7 +4,7 @@ USING: kernel arrays sequences fry math combinators ;
 \r
 IN: adsoda.combinators\r
 \r
-! : (combinations) ( seq -- seq ) [ 1 tail ] dip combinations ; \r
+! : (combinations) ( seq -- seq ) [ 1 tail ] dip combinations ;\r
 \r
 ! : prefix-each [ prefix ] curry map ; inline\r
 \r
@@ -13,7 +13,7 @@ IN: adsoda.combinators
 !        { [ dup 0 = ] [ 2drop { { } } ] }\r
 !        { [ over empty? ] [ 2drop { } ] }\r
 !        { [ t ] [ \r
-!            [ [ 1- (combinations) ] [ drop first ] 2bi prefix-each ]\r
+!            [ [ 1 - (combinations) ] [ drop first ] 2bi prefix-each ]\r
 !            [ (combinations) ] 2bi append\r
 !        ] }\r
 !    } cond ;\r
@@ -26,7 +26,7 @@ IN: adsoda.combinators
         { [ over 1 = ] [ 3drop columnize ] }\r
         { [ over 0 = ] [ 2drop 2drop { } ] }\r
         { [ 2dup < ] [ 2drop [ 1 cut ] dip  \r
-                         [ 1- among [ append ] with map  ] \r
+                         [ 1 - among [ append ] with map  ] \r
                          [ among append ] 2bi\r
                        ] }\r
         { [ 2dup = ] [ 3drop 1array ] }\r
@@ -34,7 +34,8 @@ IN: adsoda.combinators
     } cond\r
 ;\r
 \r
-: concat-nth ( seq1 seq2 -- seq )  [ nth append ] curry map-index ;\r
+: concat-nth ( seq1 seq2 -- seq )  \r
+    [ nth append ] curry map-index ;\r
 \r
 : do-cycle   ( array -- array )   dup first suffix ;\r
 \r