Handbook
Glossary
unrolled-map-as ( seq len quot: ( x -- newx ) exemplar -- newseq )
Unrolled sequence iteration combinators
Prev:
unrolled-map-index ( seq len quot: ( x i -- newx ) -- newseq )
Next:
unrolled-2map ( xseq yseq len quot: ( x y -- newx ) -- newseq )
Vocabulary
sequences
.
unrolled
Inputs
seq
a
sequence
len
an
integer
quot
a
quotation
with stack effect
( x -- newx )
exemplar
a
sequence
Outputs
newseq
a
sequence
Word description
Unrolled version of
map-as
that maps over the first
len
elements of
seq
.
len
must be a compile-time constant. If
seq
has fewer than
len
elements, raises an
unrolled-bounds-error
.
Definition
USING:
kernel
sequences.unrolled.private
;
IN:
sequences.unrolled
:
unrolled-map-as
( seq len quot: ( x -- newx ) exemplar -- newseq )
[
unrolled-bounds-check
]
dip
unrolled-map-as-unsafe
;
inline