2count ( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... ? ) -- ... n )


Vocabulary
sequences.extras

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


Outputs
nan integer


Word description
Efficiently counts how many pairwise elements of seq1 and seq2 that the predicate quotation matches.

Examples
USING: kernel prettyprint sequences.extras ; { 1 2 3 } { 3 2 1 } [ = ] 2count .
1


See also
count

Definition


: 2count
( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... ? ) -- ... n )
[ 1 0 ? ] compose 2map-sum ; inline