2map-index ( ... seq1 seq2 quot: ( ... elt1 elt2 index -- ... newelt ) -- ... newseq )


Vocabulary
sequences.extras

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


Outputs
newseqa sequence


Word description
Calls the quotation with each pair of elements of the two sequences and their index on the stack, with the index on the top of the stack. Collects the outputs of the quotation and outputs them into a new sequence of the same type as the first sequence.

See also
2map, map-index

Definition


: 2map-index
( ... seq1 seq2 quot: ( ... elt1 elt2 index -- ... newelt ) -- ... newseq )
pick [ 2sequence-index-iterator ] dip map-integers-as ;
inline