2map-sum ( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... n ) -- ... n )


Vocabulary
sequences.extras

Inputs
seq1a sequence
seq2a sequence
quota quotation


Outputs
nan integer


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. The resulting sequence is summed.

Definition


: 2map-sum
( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... n ) -- ... n )
[ 0 ] 3dip [ dip + ] curry [ rot ] prepose 2each ; inline