! 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 )
(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
] ;