]> gitweb.factorcode.org Git - factor.git/blobdiff - core/sequences/sequences-docs.factor
sequences: Add 2any? combinator
[factor.git] / core / sequences / sequences-docs.factor
index 690e888ca1675a3272e43ee44e1ba595368c62ae..85613f68c9f79ff4cafcbf7a50b66fa3786966e3 100644 (file)
@@ -491,7 +491,7 @@ HELP: 3map-as
 
 HELP: 2all?
 { $values { "seq1" sequence } { "seq2" sequence } { "quot" { $quotation ( ... elt1 elt2 -- ... ? ) } } { "?" boolean } }
-{ $description "Tests the predicate pairwise against elements of " { $snippet "seq1" } " and " { $snippet "seq2" } ". If the sequences have different lengths, then only the smallest sequences items are compared with the other." }
+{ $description "Tests if all pairwise elements of " { $snippet "seq1" } " and " { $snippet "seq2" } " fulfill the predicate. If the sequences have different lengths, then only the smallest sequences items are compared with the other." }
 { $examples
   { $example
     "USING: math prettyprint sequences ;"
@@ -500,6 +500,17 @@ HELP: 2all?
   }
 } ;
 
+HELP: 2any?
+{ $values { "seq1" sequence } { "seq2" sequence } { "quot" { $quotation ( ... elt1 elt2 -- ... ? ) } } { "?" boolean } }
+{ $description "Tests if any pairwise elements of " { $snippet "seq1" } " and " { $snippet "seq2" } " fulfill the predicate. If the sequences have different lengths, then only the smallest sequences items are compared with the other." }
+{ $examples
+  { $example
+    "USING: math prettyprint sequences ;"
+    "{ 2 4 5 8 } { 2 4 6 8 } [ < ] 2any? ."
+    "t"
+  }
+} ;
+
 HELP: find
 { $values { "seq" sequence }
           { "quot" { $quotation ( ... elt -- ... ? ) } }