]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences: moving none? to core.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 14 Feb 2018 19:23:03 +0000 (11:23 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 14 Feb 2018 19:23:03 +0000 (11:23 -0800)
core/sequences/sequences-docs.factor
core/sequences/sequences.factor
extra/sequences/extras/extras.factor

index af69bbebd9dc983737daba51f3ae941748dfc94e..1c8dcf80c081f0661f99f9f7ef21f0e34edee583 100644 (file)
@@ -546,6 +546,10 @@ HELP: any?
 { $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... ? ) } } { "?" boolean } }
 { $description "Tests if the sequence contains an element satisfying the predicate, by applying the predicate to each element in turn until a true value is found. If the sequence is empty or if the end of the sequence is reached, outputs " { $link f } "." } ;
 
+HELP: none?
+{ $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... ? ) } } { "?" boolean } }
+{ $description "Tests if the sequence does not contain any element satisfying the predicate, by applying the predicate to each element in turn until a true value is found. If the sequence is empty or if the end of the sequence is reached, outputs " { $link t } "." } ;
+
 HELP: all?
 { $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... ? ) } } { "?" boolean } }
 { $description "Tests if all elements in the sequence satisfy the predicate by checking each element in turn. Given an empty sequence, vacuously outputs " { $link t } "." } ;
index e40e90cc488db34ffc7934c2e449baab1c909cb4..67b20a58868f79647ed627b75722f7e7f82a82d2 100644 (file)
@@ -654,6 +654,9 @@ PRIVATE>
 : any? ( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
     find drop >boolean ; inline
 
+: none? ( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
+    any? not ; inline
+
 : member? ( elt seq -- ? )
     [ = ] with any? ;
 
index bf49f8c4d5fec9e1923aaf46cbeb3cc69b881554..83febd65f775f2085d59b840e9ea68c777218f24 100644 (file)
@@ -355,9 +355,6 @@ PRIVATE>
 : unsurround ( newseq seq2 seq3 -- seq1 )
    [ ?head drop ] [ ?tail drop ] bi* ;
 
-: none? ( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
-    any? not ; inline
-
 : one? ( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
     [ find ] 2keep rot [
         [ 1 + ] 2dip find-from drop not