]> gitweb.factorcode.org Git - factor.git/blobdiff - core/sequences/sequences-docs.factor
sequences: adding cartesian-find.
[factor.git] / core / sequences / sequences-docs.factor
index 2404d2e17e760fb4b9372e9fa8d54e7d2829b9d4..1ce18af8b25212d62cf478245feb42090626d3f8 100644 (file)
@@ -1621,6 +1621,10 @@ HELP: assert-sequence=
   }
 } ;
 
+HELP: cartesian-find
+{ $values { "seq1" sequence } { "seq2" sequence } { "quot" { $quotation ( ... elt1 elt2 -- ... ? ) } } { "elt1" object } { "elt2" object } }
+{ $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." } ;
+
 HELP: cartesian-each
 { $values { "seq1" sequence } { "seq2" sequence } { "quot" { $quotation ( ... elt1 elt2 -- ... ) } } }
 { $description "Applies the quotation to every possible pairing of elements from the two sequences." } ;
@@ -1981,6 +1985,7 @@ $nl
 { $subsections
     cartesian-each
     cartesian-map
+    cartesian-find
 }
 "Computing the cartesian product of two sequences:"
 { $subsections