]> gitweb.factorcode.org Git - factor.git/commitdiff
Make reference to resizable more explict.
authorDave Carlton <davec@mac.com>
Tue, 14 Mar 2023 21:18:29 +0000 (16:18 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 15 Mar 2023 00:51:28 +0000 (19:51 -0500)
core/sequences/sequences-docs.factor

index f75224c53f7597376cc90181b42f5cc71087bbbd..b97bcaa6d2015da9e04205d0f6a940c6f53fa168 100644 (file)
@@ -603,9 +603,17 @@ HELP: reject-as
 { $description "Applies the quotation to each element in turn, and outputs a new sequence of the same type as " { $snippet "exemplar" } " remove the elements of the original sequence for which the quotation output a true value." } ;
 
 HELP: reject!
-{ $values { "seq" "a resizable mutable sequence" } { "quot" { $quotation ( ... elt -- ... ? ) } } }
+{ $values { "seq" "a resizable mutable sequence." } { "quot" { $quotation ( ... elt -- ... ? ) } } }
 { $description "Applies the quotation to each element in turn, and removes elements for which the quotation outputs a true value." }
-{ $side-effects "seq" } ;
+{ $notes "seq MUST be resizeable ( see " { $link "vectors" } ")." } 
+{ $side-effects "seq" }
+{ $examples
+  "Remove the odd numbers"
+  { $example
+    "USING: sequences ;"
+    "V{ 1 2 3 4 5 6 7 8 9 0 } [ odd? ] reject! . "
+    "V{ 2 4 6 }"
+  } } ;
 
 HELP: interleave
 { $values { "seq" sequence } { "between" quotation } { "quot" { $quotation ( ... elt -- ... ) } } }