sequences, syntax, vocabs.parser: remove useless whitespace in docs

db4
Keita Haga 2010-12-23 03:41:34 +09:00
parent 33c14b8bb0
commit dcb387630b
3 changed files with 41 additions and 41 deletions

View File

@ -15,7 +15,7 @@ HELP: length
HELP: set-length HELP: set-length
{ $values { "n" "a non-negative integer" } { "seq" "a resizable sequence" } } { $values { "n" "a non-negative integer" } { "seq" "a resizable sequence" } }
{ $contract "Resizes a sequence. The initial contents of the new area is undefined." } { $contract "Resizes a sequence. The initial contents of the new area is undefined." }
{ $errors "Throws a " { $link no-method } " error if the sequence is not resizable, and a " { $link bounds-error } " if the new length is negative." } { $errors "Throws a " { $link no-method } " error if the sequence is not resizable, and a " { $link bounds-error } " if the new length is negative." }
{ $side-effects "seq" } ; { $side-effects "seq" } ;
HELP: lengthen HELP: lengthen
@ -248,7 +248,7 @@ HELP: array-nth
{ $warning "This word is in the " { $vocab-link "sequences.private" } " vocabulary because it is unsafe. It does not check types or array bounds, and improper use can corrupt memory. User code must use " { $link nth } " instead." } ; { $warning "This word is in the " { $vocab-link "sequences.private" } " vocabulary because it is unsafe. It does not check types or array bounds, and improper use can corrupt memory. User code must use " { $link nth } " instead." } ;
HELP: set-array-nth HELP: set-array-nth
{ $values { "elt" object } { "n" "a non-negative fixnum" } { "array" "an array" } } { $values { "elt" object } { "n" "a non-negative fixnum" } { "array" "an array" } }
{ $description "Low-level array element mutator." } { $description "Low-level array element mutator." }
{ $warning "This word is in the " { $vocab-link "sequences.private" } " vocabulary because it is unsafe. It does not check types or array bounds, and improper use can corrupt memory. User code must use " { $link set-nth } " instead." } ; { $warning "This word is in the " { $vocab-link "sequences.private" } " vocabulary because it is unsafe. It does not check types or array bounds, and improper use can corrupt memory. User code must use " { $link set-nth } " instead." } ;
@ -992,7 +992,7 @@ HELP: selector
{ $values { $values
{ "quot" { $quotation "( ... elt -- ... ? )" } } { "quot" { $quotation "( ... elt -- ... ? )" } }
{ "selector" { $quotation "( ... elt -- ... )" } } { "accum" vector } } { "selector" { $quotation "( ... elt -- ... )" } } { "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 collector if the test yields true. The collector is left on the stack for convenience." } { $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 collector if the test yields true. The collector is left on the stack for convenience." }
{ $example "! Find all the even numbers:" "USING: prettyprint sequences math kernel ;" { $example "! Find all the even numbers:" "USING: prettyprint sequences math kernel ;"
"10 iota [ even? ] selector [ each ] dip ." "10 iota [ even? ] selector [ each ] dip ."
"V{ 0 2 4 6 8 }" "V{ 0 2 4 6 8 }"
@ -1004,7 +1004,7 @@ HELP: trim-head
{ "seq" sequence } { "quot" quotation } { "seq" sequence } { "quot" quotation }
{ "newseq" sequence } } { "newseq" sequence } }
{ $description "Removes elements starting from the left side of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a new sequence." } { $description "Removes elements starting from the left side of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a new sequence." }
{ $example "" "USING: prettyprint math sequences ;" { $example "USING: prettyprint math sequences ;"
"{ 0 0 1 2 3 0 0 } [ zero? ] trim-head ." "{ 0 0 1 2 3 0 0 } [ zero? ] trim-head ."
"{ 1 2 3 0 0 }" "{ 1 2 3 0 0 }"
} ; } ;
@ -1014,7 +1014,7 @@ HELP: trim-head-slice
{ "seq" sequence } { "quot" quotation } { "seq" sequence } { "quot" quotation }
{ "slice" slice } } { "slice" slice } }
{ $description "Removes elements starting from the left side of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a slice" } { $description "Removes elements starting from the left side of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a slice" }
{ $example "" "USING: prettyprint math sequences ;" { $example "USING: prettyprint math sequences ;"
"{ 0 0 1 2 3 0 0 } [ zero? ] trim-head-slice ." "{ 0 0 1 2 3 0 0 } [ zero? ] trim-head-slice ."
"T{ slice { from 2 } { to 7 } { seq { 0 0 1 2 3 0 0 } } }" "T{ slice { from 2 } { to 7 } { seq { 0 0 1 2 3 0 0 } } }"
} ; } ;
@ -1024,7 +1024,7 @@ HELP: trim-tail
{ "seq" sequence } { "quot" quotation } { "seq" sequence } { "quot" quotation }
{ "newseq" sequence } } { "newseq" sequence } }
{ $description "Removes elements starting from the right side of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a new sequence." } { $description "Removes elements starting from the right side of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a new sequence." }
{ $example "" "USING: prettyprint math sequences ;" { $example "USING: prettyprint math sequences ;"
"{ 0 0 1 2 3 0 0 } [ zero? ] trim-tail ." "{ 0 0 1 2 3 0 0 } [ zero? ] trim-tail ."
"{ 0 0 1 2 3 }" "{ 0 0 1 2 3 }"
} ; } ;
@ -1034,7 +1034,7 @@ HELP: trim-tail-slice
{ "seq" sequence } { "quot" quotation } { "seq" sequence } { "quot" quotation }
{ "slice" slice } } { "slice" slice } }
{ $description "Removes elements starting from the right side of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a slice." } { $description "Removes elements starting from the right side of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a slice." }
{ $example "" "USING: prettyprint math sequences ;" { $example "USING: prettyprint math sequences ;"
"{ 0 0 1 2 3 0 0 } [ zero? ] trim-tail-slice ." "{ 0 0 1 2 3 0 0 } [ zero? ] trim-tail-slice ."
"T{ slice { from 0 } { to 5 } { seq { 0 0 1 2 3 0 0 } } }" "T{ slice { from 0 } { to 5 } { seq { 0 0 1 2 3 0 0 } } }"
} ; } ;
@ -1044,7 +1044,7 @@ HELP: trim
{ "seq" sequence } { "quot" quotation } { "seq" sequence } { "quot" quotation }
{ "newseq" sequence } } { "newseq" sequence } }
{ $description "Removes elements starting from the left and right sides of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a new sequence." } { $description "Removes elements starting from the left and right sides of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a new sequence." }
{ $example "" "USING: prettyprint math sequences ;" { $example "USING: prettyprint math sequences ;"
"{ 0 0 1 2 3 0 0 } [ zero? ] trim ." "{ 0 0 1 2 3 0 0 } [ zero? ] trim ."
"{ 1 2 3 }" "{ 1 2 3 }"
} ; } ;
@ -1054,7 +1054,7 @@ HELP: trim-slice
{ "seq" sequence } { "quot" quotation } { "seq" sequence } { "quot" quotation }
{ "slice" slice } } { "slice" slice } }
{ $description "Removes elements starting from the left and right sides of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a slice." } { $description "Removes elements starting from the left and right sides of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a slice." }
{ $example "" "USING: prettyprint math sequences ;" { $example "USING: prettyprint math sequences ;"
"{ 0 0 1 2 3 0 0 } [ zero? ] trim-slice ." "{ 0 0 1 2 3 0 0 } [ zero? ] trim-slice ."
"T{ slice { from 2 } { to 5 } { seq { 0 0 1 2 3 0 0 } } }" "T{ slice { from 2 } { to 5 } { seq { 0 0 1 2 3 0 0 } } }"
} ; } ;
@ -1065,7 +1065,7 @@ HELP: sift
{ $values { $values
{ "seq" sequence } { "seq" sequence }
{ "newseq" sequence } } { "newseq" sequence } }
{ $description "Outputs a new sequence with all instance of " { $link f } " removed." } { $description "Outputs a new sequence with all instance of " { $link f } " removed." }
{ $examples { $examples
{ $example "USING: prettyprint sequences ;" { $example "USING: prettyprint sequences ;"
"{ \"a\" 3 { } f } sift ." "{ \"a\" 3 { } f } sift ."
@ -1093,7 +1093,7 @@ HELP: set-first
{ $description "Sets the first element of a sequence." } { $description "Sets the first element of a sequence." }
{ $examples { $examples
{ $example "USING: prettyprint kernel sequences ;" { $example "USING: prettyprint kernel sequences ;"
"{ 1 2 3 4 } 5 over set-first ." "{ 1 2 3 4 } 5 over set-first ."
"{ 5 2 3 4 }" "{ 5 2 3 4 }"
} }
} ; } ;
@ -1104,7 +1104,7 @@ HELP: set-second
{ $description "Sets the second element of a sequence." } { $description "Sets the second element of a sequence." }
{ $examples { $examples
{ $example "USING: prettyprint kernel sequences ;" { $example "USING: prettyprint kernel sequences ;"
"{ 1 2 3 4 } 5 over set-second ." "{ 1 2 3 4 } 5 over set-second ."
"{ 1 5 3 4 }" "{ 1 5 3 4 }"
} }
} ; } ;
@ -1115,7 +1115,7 @@ HELP: set-third
{ $description "Sets the third element of a sequence." } { $description "Sets the third element of a sequence." }
{ $examples { $examples
{ $example "USING: prettyprint kernel sequences ;" { $example "USING: prettyprint kernel sequences ;"
"{ 1 2 3 4 } 5 over set-third ." "{ 1 2 3 4 } 5 over set-third ."
"{ 1 2 5 4 }" "{ 1 2 5 4 }"
} }
} ; } ;
@ -1126,7 +1126,7 @@ HELP: set-fourth
{ $description "Sets the fourth element of a sequence." } { $description "Sets the fourth element of a sequence." }
{ $examples { $examples
{ $example "USING: prettyprint kernel sequences ;" { $example "USING: prettyprint kernel sequences ;"
"{ 1 2 3 4 } 5 over set-fourth ." "{ 1 2 3 4 } 5 over set-fourth ."
"{ 1 2 3 5 }" "{ 1 2 3 5 }"
} }
} ; } ;
@ -1163,7 +1163,7 @@ HELP: partition
{ $values { $values
{ "seq" sequence } { "quot" quotation } { "seq" sequence } { "quot" quotation }
{ "trueseq" sequence } { "falseseq" sequence } } { "trueseq" sequence } { "falseseq" sequence } }
{ $description "Calls a predicate quotation on each element of the input sequence. If the test yields true, the element is added to " { $snippet "trueseq" } "; if false, it's added to " { $snippet "falseseq" } "." } { $description "Calls a predicate quotation on each element of the input sequence. If the test yields true, the element is added to " { $snippet "trueseq" } "; if false, it's added to " { $snippet "falseseq" } "." }
{ $examples { $examples
{ $example "USING: prettyprint kernel math sequences ;" { $example "USING: prettyprint kernel math sequences ;"
"{ 1 2 3 4 5 } [ even? ] partition [ . ] bi@" "{ 1 2 3 4 5 } [ even? ] partition [ . ] bi@"

View File

@ -195,7 +195,7 @@ ARTICLE: "syntax-hash-sets" "Hash set syntax"
ARTICLE: "syntax-tuples" "Tuple syntax" ARTICLE: "syntax-tuples" "Tuple syntax"
{ $subsections POSTPONE: T{ } { $subsections POSTPONE: T{ }
"Tuples are documented in " { $link "tuples" } "." ; "Tuples are documented in " { $link "tuples" } "." ;
ARTICLE: "syntax-quots" "Quotation syntax" ARTICLE: "syntax-quots" "Quotation syntax"
{ $subsections { $subsections
@ -370,7 +370,7 @@ HELP: HS{
HELP: C{ HELP: C{
{ $syntax "C{ real-part imaginary-part }" } { $syntax "C{ real-part imaginary-part }" }
{ $values { "real-part" "a real number" } { "imaginary-part" "a real number" } } { $values { "real-part" "a real number" } { "imaginary-part" "a real number" } }
{ $description "Parses a complex number given in rectangular form as a pair of real numbers. Literal complex numbers are terminated by " { $link POSTPONE: } } "." } ; { $description "Parses a complex number given in rectangular form as a pair of real numbers. Literal complex numbers are terminated by " { $link POSTPONE: } } "." } ;
HELP: T{ HELP: T{
{ $syntax "T{ class }" "T{ class f slot-values... }" "T{ class { slot-name slot-value } ... }" } { $syntax "T{ class }" "T{ class f slot-values... }" "T{ class { slot-name slot-value } ... }" }
@ -560,7 +560,7 @@ HELP: FROM:
HELP: EXCLUDE: HELP: EXCLUDE:
{ $syntax "EXCLUDE: vocab => words ... ;" } { $syntax "EXCLUDE: vocab => words ... ;" }
{ $description "Adds all words except for " { $snippet "words" } " from " { $snippet "vocab" } " to the search path." } { $description "Adds all words except for " { $snippet "words" } " from " { $snippet "vocab" } " to the search path." }
{ $examples { $code { $examples { $code
"EXCLUDE: math.parser => bin> hex> ;" "! imports everything but bin> and hex>" } } ; "EXCLUDE: math.parser => bin> hex> ;" "! imports everything but bin> and hex>" } } ;
@ -728,7 +728,7 @@ HELP: HOOK:
"TUPLE: air-transport ;" "TUPLE: air-transport ;"
"HOOK: deliver transport ( destination -- )" "HOOK: deliver transport ( destination -- )"
"M: land-transport deliver \"Land delivery to \" write print ;" "M: land-transport deliver \"Land delivery to \" write print ;"
"M: air-transport deliver \"Air delivery to \" write print ;" "M: air-transport deliver \"Air delivery to \" write print ;"
"T{ air-transport } transport set" "T{ air-transport } transport set"
"\"New York City\" deliver" "\"New York City\" deliver"
"Air delivery to New York City" "Air delivery to New York City"

View File

@ -1,7 +1,7 @@
USING: help.markup help.syntax parser strings words assocs vocabs ; USING: help.markup help.syntax parser strings words assocs vocabs ;
IN: vocabs.parser IN: vocabs.parser
ARTICLE: "word-search-errors" "Word lookup errors" ARTICLE: "word-search-errors" "Word lookup errors"
"If the parser cannot not find a word in the current vocabulary search path, it attempts to look for the word in all loaded vocabularies." "If the parser cannot not find a word in the current vocabulary search path, it attempts to look for the word in all loaded vocabularies."
$nl $nl
"If " { $link auto-use? } " mode is off, a restartable error is thrown with a restart for each vocabulary in question, together with a restart which defers the word in the current vocabulary, as if " { $link POSTPONE: DEFER: } " was used." "If " { $link auto-use? } " mode is off, a restartable error is thrown with a restart for each vocabulary in question, together with a restart which defers the word in the current vocabulary, as if " { $link POSTPONE: DEFER: } " was used."
@ -142,7 +142,7 @@ HELP: add-words-from
HELP: add-words-excluding HELP: add-words-excluding
{ $values { "vocab" "a vocabulary specifier" } { "words" "a sequence of word names" } } { $values { "vocab" "a vocabulary specifier" } { "words" "a sequence of word names" } }
{ $description "Adds all words except for " { $snippet "words" } " from " { $snippet "vocab" } " to the manifest." } { $description "Adds all words except for " { $snippet "words" } " from " { $snippet "vocab" } " to the manifest." }
{ $notes "This word is used to implement " { $link POSTPONE: EXCLUDE: } "." } ; { $notes "This word is used to implement " { $link POSTPONE: EXCLUDE: } "." } ;
HELP: add-renamed-word HELP: add-renamed-word