2map ( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... newelt ) -- ... newseq )
Factor handbook > The language > Collections > Sequence operations > Sequence combinators > Pair-wise sequence combinators

Prev:2reduce ( ... seq1 seq2 identity quot: ( ... prev elt1 elt2 -- ... next ) -- ... result )
Next:2map-as ( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... newelt ) exemplar -- ... newseq )


Vocabulary
sequences

Inputs and outputs
seq1a sequence
seq2a sequence
quota quotation with stack effect ( ... elt1 elt2 -- ... newelt )
newseqa new sequence


Word description
Applies the quotation to each pair of elements in turn, yielding new elements which are collected into a new sequence having the same class as seq1.

See also
v+, v-, v*, v/

Definition


: 2map
( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... newelt ) -- ... newseq )
pick 2map-as ; inline