Unrolled sequence iteration combinators


The sequences.unrolled vocabulary provides versions of some of the Sequence combinators that unroll their loops, that is, expand to a constant number of repetitions of a quotation rather than an explicit loop. These unrolled combinators all require a constant integer value to indicate the number of unrolled iterations to perform.

Unrolled versions of high-level iteration combinators:
unrolled-each ( seq len quot: ( x -- ) -- )

unrolled-each-index ( seq len quot: ( x i -- ) -- )

unrolled-2each ( xseq yseq len quot: ( x y -- ) -- )

unrolled-map ( seq len quot: ( x -- newx ) -- newseq )

unrolled-map-index ( seq len quot: ( x i -- newx ) -- newseq )

unrolled-map-as ( seq len quot: ( x -- newx ) exemplar -- newseq )

unrolled-2map ( xseq yseq len quot: ( x y -- newx ) -- newseq )

unrolled-2map-as ( xseq yseq len quot: ( x y -- newx ) exemplar -- newseq )


Unrolled versions of low-level iteration combinators:
unrolled-each-integer ( n quot: ( i -- ) -- )

unrolled-map-integers-as ( n quot: ( n -- value ) exemplar -- newseq )

unrolled-collect ( n quot: ( n -- value ) into -- )