map ( ... seq quot: ( ... elt -- ... newelt ) -- ... newseq )
Factor handbook » The language » Collections » Sequence operations » Sequence combinators

Prev:interleave ( ... seq between quot: ( ... elt -- ... ) -- ... )
Next:map-as ( ... seq quot: ( ... elt -- ... newelt ) exemplar -- ... newseq )


Vocabulary
sequences

Inputs
seqa sequence
quota quotation with stack effect ( ... elt -- ... newelt )


Outputs
newseqa new sequence


Word description
Applies the quotation to each element of the sequence in order. The new elements are collected into a sequence of the same class as the input sequence.

See also
map!, map-as, map-index, map-index-as

Definition


: map
( ... seq quot: ( ... elt -- ... newelt ) -- ... newseq )
over map-as ; inline