]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix sequences docs for change-nth stack effect and example needed using section
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 21 Sep 2011 15:09:03 +0000 (10:09 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 21 Sep 2011 15:09:03 +0000 (10:09 -0500)
core/sequences/sequences-docs.factor

index 22e1eede419c745d9b74e326b4a213c9fef5f2d6..58ead11caa8ce893b64b7088599c2d27e3cebd6c 100644 (file)
@@ -340,7 +340,7 @@ HELP: map-index
 } } ;
 
 HELP: change-nth
-{ $values { "i" "a non-negative integer" } { "seq" "a mutable sequence" } { "quot" { $quotation "( ... elt -- ... newelt )" } } }
+{ $values { "i" "a non-negative integer" } { "seq" "a mutable sequence" } { "quot" { $quotation "( ..a elt -- ..b newelt )" } } }
 { $description "Applies the quotation to the " { $snippet "i" } "th element of the sequence, storing the result back into the sequence." }
 { $errors "Throws an error if the sequence is immutable, if the index is out of bounds, or the sequence cannot hold elements of the type output by " { $snippet "quot" } "." }
 { $side-effects "seq" } ;
@@ -1440,7 +1440,7 @@ ARTICLE: "sequences-integers" "Counted loops"
 "A virtual sequence is defined for iterating over integers from zero."
 { $subsection iota }
 "For example, calling " { $link iota } " on the integer 3 produces a sequence containing the elements 0, 1, and 2. This is very useful for performing counted loops using words such as " { $link each } ":"
-{ $example "3 iota [ . ] each" "0\n1\n2" }
+{ $example "USING: sequences prettyprint ; 3 iota [ . ] each" "0\n1\n2" }
 "A common idiom is to iterate over a sequence, while also maintaining a loop counter. This can be done using " { $link each-index } ", " { $link map-index } " and " { $link reduce-index } "."
 $nl
 "Combinators that produce new sequences, such as " { $link map } ", will output an array if the input is an instance of " { $link iota } "."