]> gitweb.factorcode.org Git - factor.git/commitdiff
combinators.smart: using each-from.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 25 Oct 2017 00:05:23 +0000 (17:05 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 25 Oct 2017 00:05:23 +0000 (17:05 -0700)
basis/combinators/smart/smart.factor

index e633ce4d33488847b6c769e4a0d0ced44e1f224c..9102cfbc0281bf60e33cb0db1fb9794863d933d5 100644 (file)
@@ -146,7 +146,7 @@ MACRO: smart-map-reduce ( map-reduce-quots -- quot )
     [ keys ] [ [ [ ] concat-as ] [ ] map-as ] bi dup length dup '[
         [ first _ cleave ] keep
         [ @ _ cleave-curry _ spread* ]
-        [ 1 ] 2dip setup-each (each-integer)
+        1 each-from
     ] ;
 
 MACRO: smart-2reduce ( 2reduce-quots -- quot )
@@ -159,5 +159,5 @@ MACRO: smart-2map-reduce ( 2map-reduce-quots -- quot )
     [ keys ] [ [ [ ] concat-as ] [ ] map-as ] bi dup length dup '[
         [ [ first ] bi@ _ 2cleave ] 2keep
         [ @ _ [ cleave-curry ] [ cleave-curry ] bi _ spread* ]
-        [ 1 ] 3dip (2each) (each-integer)
+        1 2each-from
     ] ;