]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences: extra doc and test for 2all?
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 21 Sep 2015 10:29:29 +0000 (12:29 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Tue, 22 Sep 2015 06:52:59 +0000 (08:52 +0200)
core/sequences/sequences-docs.factor
core/sequences/sequences-tests.factor

index b535883baf8199047492559d1d0edf38a92f972e..b6d219c5e9fa1791b8b74a6db9c0efe8690fbb98 100644 (file)
@@ -443,7 +443,13 @@ 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" } "." } ;
+{ $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." }
+{ $examples
+  { $example "USING: prettyprint sequences ;"
+    "{ 1 2 3 4 } { 2 4 6 8 } [ <= ] 2all? ."
+    "t"
+  }
+} ;
 
 HELP: find
 { $values { "seq" sequence }
index de61cebdaedf329045193a83f7efce1e6cd50b06..486ea209193dfae0e3e00db3a8dbb907b1a1510f 100644 (file)
@@ -406,3 +406,5 @@ USE: make
 {
     BV{ 11 23 35 }
 } [ { 11 22 33 } [ + ] BV{ } map-index-as ] unit-test
+
+{ t } [ { } { 99 88 } [ <= ] 2all? ] unit-test