]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences.generalizations: fix finish-nfind use of times.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 5 Oct 2019 01:15:19 +0000 (18:15 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 5 Oct 2019 01:15:19 +0000 (18:15 -0700)
(that didn't work in optimizing compiler).

basis/sequences/generalizations/generalizations.factor

index 207d7e839383cf98d582998a831a039403be88fc..5290e60777c195b0708bc832dd64466728466f16 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2009 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: combinators fry generalizations kernel macros math
-math.order memoize.private sequences sequences.private ;
+USING: arrays combinators fry generalizations kernel macros math
+math.order memoize.private quotations sequences
+sequences.private ;
 IN: sequences.generalizations
 
 MACRO: (nsequence) ( n -- quot )
@@ -128,10 +129,10 @@ MACRO: nmap-reduce ( map-quot reduce-quot n -- quot )
     (neach) all-integers? ; inline
 
 MACRO: finish-nfind ( n -- quot )
-    [ 1 + ] keep dup dup dup '[
+    [ 1 + ] keep dup dup dup f <array> >quotation '[
         _ npick
         [ [ dup ] _ ndip _ nnth-unsafe ]
-        [ _ ndrop _ [ f ] times ]
+        [ _ ndrop @ ]
         if
     ] ;