]> gitweb.factorcode.org Git - factor.git/blobdiff - core/sequences/sequences-docs.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / core / sequences / sequences-docs.factor
index 2b0a07739a305cdfa33cea7bf168de96de53331f..9f570f97d5af49645c975d0b328f05c8fadbafea 100644 (file)
@@ -999,7 +999,7 @@ HELP: pusher
      { "quot" quotation } { "accum" vector } }
 { $description "Creates a new vector to accumulate the values which return true for a predicate.  Returns a new quotation which accepts an object to be tested and stored in the accumulator if the test yields true. The accumulator is left on the stack for convenience." }
 { $example "! Find all the even numbers:" "USING: prettyprint sequences math kernel ;"
-           "10 [ even? ] pusher [ each ] dip ."
+           "10 iota [ even? ] pusher [ each ] dip ."
            "V{ 0 2 4 6 8 }"
 }
 { $notes "Used to implement the " { $link filter } " word. Compare this word with " { $link accumulator } ", which is an unfiltering version." } ;
@@ -1241,7 +1241,7 @@ HELP: binary-reduce
 { $description "Like " { $link reduce } ", but splits the sequence in half recursively until each sequence is small enough, and calls the quotation on these smaller sequences. If the quotation computes values that depend on the size of their input, such as bignum arithmetic, then this algorithm can be more efficient than using " { $link reduce } "." }
 { $examples "Computing factorial:"
     { $example "USING: prettyprint sequences math ;"
-    "40 rest-slice 1 [ * ] binary-reduce ."
+    "40 iota rest-slice 1 [ * ] binary-reduce ."
     "20397882081197443358640281739902897356800000000" }
 } ;