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

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


Vocabulary
sequences

Inputs
seq1a sequence
seq2a sequence
quota quotation with stack effect ( ... elt1 elt2 -- ... newelt )
exemplara sequence


Outputs
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 exemplar.

Definition


: 2map-as
( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... newelt ) exemplar -- ... newseq )
[ 2length-operator ] dip map-integers-as ; inline