Vocabulary
sequences

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


Outputs
elt1an object
elt2an object


Word description
Applies the quotation to every possible pairing of elements from the two sequences, returning the first two elements where the quotation returns a true value.

Definition


: cartesian-find
( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... ? ) -- ... elt1 elt2 )
[ f ] 3dip [ with find swap ] 2curry [ nip ] prepose
find nip swap ; inline