]> gitweb.factorcode.org Git - factor.git/commitdiff
core: use $sequence help-markup in a few places.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 16 Mar 2016 17:13:25 +0000 (10:13 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 16 Mar 2016 17:13:56 +0000 (10:13 -0700)
18 files changed:
core/assocs/assocs-docs.factor
core/compiler/units/units-docs.factor
core/continuations/continuations-docs.factor
core/definitions/definitions-docs.factor
core/generic/generic-docs.factor
core/io/binary/binary-docs.factor
core/io/io-docs.factor
core/lexer/lexer-docs.factor
core/parser/parser-docs.factor
core/sbufs/sbufs-docs.factor
core/sets/sets-docs.factor
core/slots/slots-docs.factor
core/sorting/sorting-docs.factor
core/splitting/splitting-docs.factor
core/strings/strings-docs.factor
core/syntax/syntax-docs.factor
core/vocabs/loader/loader-docs.factor
core/words/words-docs.factor

index 2320768f596c0e2295164c37ac1461f4af19536d..69591c7463c554e78c613febb6bea3f796815a82 100644 (file)
@@ -394,7 +394,7 @@ HELP: assoc-hashcode
 { $notes "Custom assoc implementations should use this word to implement a method for the " { $link hashcode* } " generic word." } ;
 
 HELP: assoc-stack
-{ $values { "key" "a key" } { "seq" "a sequence of assocs" } { "value" { $maybe "a value" } } }
+{ $values { "key" "a key" } { "seq" { $sequence assoc } } { "value" { $maybe "a value" } } }
 { $description "Searches for the key in successive elements of the sequence, starting from the end. If an assoc containing the key is found, the associated value is output. If no assoc contains the key, outputs " { $link f } "." }
 { $notes "This word is used to implement abstractions such as nested scopes; if the sequence is a stack represented by a vector, then the most recently pushed assoc -- the innermost scope -- will be searched first." } ;
 
index 48bce465298bc4f8cccdf9e235bdef5dc4168ad4..a65dddb81aef7d926017a52a011e90c46f270fd6 100644 (file)
@@ -75,7 +75,7 @@ HELP: with-nested-compilation-unit
 { $notes "This word is used by " { $link "syntax-immediate" } " to ensure that definitions in nested blocks are correctly recorded. User code should not depend on parser internals in such a way that calling this combinator is required." } ;
 
 HELP: recompile
-{ $values { "words" "a sequence of words" } { "alist" "an association list mapping words to compiled definitions" } }
+{ $values { "words" { $sequence word } } { "alist" "an association list mapping words to compiled definitions" } }
 { $contract "Internal word which compiles words. Called at the end of " { $link with-compilation-unit } "." } ;
 
 HELP: to-recompile
@@ -112,5 +112,5 @@ $nl
 { $notes "This word is called at the end of " { $link with-compilation-unit } "." } ;
 
 HELP: compile
-{ $values { "words" "a sequence of words" } }
+{ $values { "words" { $sequence word } } }
 { $description "Compiles a set of words." } ;
index b188a3fb9feb82220d1de31292713a7dea4d3e29..56da38d46f3a817bb694c9d94eb5cd5289f10352 100644 (file)
@@ -199,7 +199,7 @@ HELP: rethrow
 } ;
 
 HELP: throw-restarts
-{ $values { "error" object } { "restarts" "a sequence of " { $snippet "{ string object }" } " pairs" } { "restart" object } }
+{ $values { "error" object } { "restarts" { $sequence { { $snippet "{ string object }" } " pairs" } } } { "restart" object } }
 { $description "Throws a restartable error using " { $link throw } ". The " { $snippet "restarts" } " parameter is a sequence of pairs where the first element in each pair is a human-readable description and the second is an arbitrary object. If the error reaches the top-level error handler, the user will be presented with the list of possible restarts, and upon invoking one, execution will continue after the call to " { $link throw-restarts } " with the object associated to the chosen restart on the stack." }
 { $examples
     "Try invoking one of the two restarts which are offered after the below code throws an error:"
@@ -212,7 +212,7 @@ HELP: throw-restarts
 } ;
 
 HELP: rethrow-restarts
-{ $values { "error" object } { "restarts" "a sequence of " { $snippet "{ string object }" } " pairs" } { "restart" object } }
+{ $values { "error" object } { "restarts" { $sequence { { $snippet "{ string object }" } " pairs" } } } { "restart" object } }
 { $description "Throws a restartable error using " { $link rethrow } ". Otherwise, this word is identical to " { $link throw-restarts } "." } ;
 
 { throw rethrow throw-restarts rethrow-restarts throw-continue } related-words
index dbf7c81ea9de74bce0d294a9e5eb8d894d19c814..b609c26f7221408ea617a1d276b93bd0c7ca44ae 100644 (file)
@@ -87,7 +87,7 @@ HELP: forget
 { $notes "This word must be called from inside " { $link with-compilation-unit } "." } ;
 
 HELP: forget-all
-{ $values { "definitions" "a sequence of definition specifiers" } }
+{ $values { "definitions" { $sequence "definition specifiers" } } }
 { $description "Forgets every definition in a sequence." }
 { $notes "This word must be called from inside " { $link with-compilation-unit } "." } ;
 
index 3352ac03524b0c57aa0dc8442599957e082aba32..0dc143d6d1f11a9123381c22b4bbe0f0dce7c927 100644 (file)
@@ -150,7 +150,7 @@ HELP: <method>
 { $description "Creates a new method." } ;
 
 HELP: order
-{ $values { "generic" generic } { "seq" "a sequence of classes" } }
+{ $values { "generic" generic } { "seq" { $sequence class } } }
 { $description "Outputs a sequence of classes for which methods have been defined on this generic word. The sequence is sorted in method dispatch order." } ;
 
 HELP: check-method
index 250f4e2880220be130ec8a365332f434b8484edd..078b0dfa6c5108e8d64fff985f7ebe57e0593096 100644 (file)
@@ -36,11 +36,11 @@ $nl
 ABOUT: "stream-binary"
 
 HELP: be>
-{ $values { "seq" "a sequence of bytes" } { "x" "a non-negative integer" } }
+{ $values { "seq" { $sequence "bytes" } } { "x" "a non-negative integer" } }
 { $description "Converts a sequence of bytes in big endian order into an unsigned integer." } ;
 
 HELP: le>
-{ $values { "seq" "a sequence of bytes" } { "x" "a non-negative integer" } }
+{ $values { "seq" { $sequence "bytes" } } { "x" "a non-negative integer" } }
 { $description "Converts a sequence of bytes in little endian order into an unsigned integer." } ;
 
 HELP: nth-byte
index 1e0267544ae1905ca005f308f9c9819b0472c5fa..e3fad5409d1491b39e5367ea95f5479cb669ecf8 100644 (file)
@@ -298,11 +298,11 @@ HELP: bl
 $io-error ;
 
 HELP: stream-lines
-{ $values { "stream" "an input stream" } { "seq" "a sequence of strings" } }
+{ $values { "stream" "an input stream" } { "seq" { $sequence string } } }
 { $description "Reads lines of text until the stream is exhausted, collecting them in a sequence of strings." } ;
 
 HELP: lines
-{ $values { "seq" "a sequence of strings" } }
+{ $values { "seq" { $sequence string } } }
 { $description "Reads lines of text until from the " { $link input-stream } " until it is exhausted, collecting them in a sequence of strings." } ;
 
 HELP: each-line
index 805ba90c2d8755927215693983e4ba5454341c10..96adc0816aa3b53620ea909149c37836e8b3e2f4 100644 (file)
@@ -13,7 +13,7 @@ HELP: lexer
 "Custom lexing can be implemented by delegating a tuple to an instance of this class and implementing the " { $link skip-word } " and " { $link skip-blank } " generic words." } ;
 
 HELP: <lexer>
-{ $values { "text" "a sequence of strings" } { "lexer" lexer } }
+{ $values { "text" { $sequence string } } { "lexer" lexer } }
 { $description "Creates a new lexer for tokenizing the given sequence of lines." } ;
 
 HELP: next-line
@@ -78,12 +78,12 @@ HELP: each-token
 $parsing-note ;
 
 HELP: map-tokens
-{ $values { "end" string } { "quot" { $quotation ( ... token -- ... elt ) } } { "seq" "a new sequence of " { $snippet "object" } "s" } }
+{ $values { "end" string } { "quot" { $quotation ( ... token -- ... elt ) } } { "seq" { $sequence object } } }
 { $description "Reads a sequence of tokens until the first occurrence of " { $snippet "end" } ". " { $snippet "quot" } " is called on each token as it is read, and the results are collected into a new output sequence." }
 $parsing-note ;
 
 HELP: parse-tokens
-{ $values { "end" string } { "seq" "a new sequence of strings" } }
+{ $values { "end" string } { "seq" { $sequence string } } }
 { $description "Reads a sequence of tokens until the first occurrence of " { $snippet "end" } ". The tokens remain as strings and are not processed in any way. This word is equivalent to " { $link map-tokens } " with an empty quotation." }
 $parsing-note ;
 
index f605a82988d9e699ec0b16fea6a1091ed50eb07f..45d24c3cf6b43fa45c79a52a85374e056e0191b2 100644 (file)
@@ -52,7 +52,7 @@ ARTICLE: "defining-words" "Defining words"
 "There are additional parsing words whose syntax is delimited by " { $link POSTPONE: ; } ", and they are all implemented by calling " { $link parse-definition } "." ;
 
 ARTICLE: "parsing-tokens" "Parsing raw tokens"
-"So far we have seen how to read individual tokens, or read a sequence of parsed objects until a delimiter. It is also possible to read raw tokens from the input and perform custom processing."
+"So far we have seen how to read individual tokens, or read a  of parsed objects until a delimiter. It is also possible to read raw tokens from the input and perform custom processing."
 $nl
 "One example is the " { $link POSTPONE: USING: } " parsing word."
 { $see POSTPONE: USING: }
@@ -215,7 +215,7 @@ HELP: (parse-lines)
 { $errors "Throws a " { $link lexer-error } " if the input is malformed." } ;
 
 HELP: parse-lines
-{ $values { "lines" "a sequence of strings" } { "quot" "a new " { $link quotation } } }
+{ $values { "lines" { $sequence string } } { "quot" "a new " { $link quotation } } }
 { $description "Parses Factor source code which has been tokenized into lines. The vocabulary search path is taken from the current scope." }
 { $errors "Throws a " { $link lexer-error } " if the input is malformed." } ;
 
@@ -239,12 +239,12 @@ HELP: with-file-vocabs
 { $description "Calls the quotation in a scope with an initial vocabulary search path consisting of just the " { $snippet "syntax" } " vocabulary." } ;
 
 HELP: parse-fresh
-{ $values { "lines" "a sequence of strings" } { "quot" quotation } }
+{ $values { "lines" { $sequence string } } { "quot" quotation } }
 { $description "Parses Factor source code in a sequence of lines. The initial vocabulary search path is used (see " { $link with-file-vocabs } ")." }
 { $errors "Throws a parse error if the input is malformed." } ;
 
 HELP: filter-moved
-{ $values { "set1" set } { "set2" set } { "seq" "an sequence of definitions" } }
+{ $values { "set1" set } { "set2" set } { "seq" { $sequence "definitions" } } }
 { $description "Removes all definitions from " { $snippet "set2" } " which are in " { $snippet "set1" } " or are no longer present in the " { $link current-source-file } "." } ;
 
 HELP: forget-smudged
index fa2db15aad3001fd150614de6c1cb0fe57c0744b..badf27fa3526ec99c491cbc456bc729e696d4f85 100644 (file)
@@ -30,6 +30,6 @@ HELP: <sbuf>
 { $description "Creates a new string buffer that can hold " { $snippet "n" } " characters before resizing." } ;
 
 HELP: >sbuf
-{ $values { "seq" "a sequence of non-negative integers" } { "sbuf" sbuf } }
+{ $values { "seq" { $sequence "non-negative integers" } } { "sbuf" sbuf } }
 { $description "Outputs a freshly-allocated string buffer with the same elements as a given sequence." }
 { $errors "Throws an error if the sequence contains elements other than real numbers." } ;
index 2ff4e82ebf9daca160406cbb860ae7ac0b21b81d..481a6ed6aca168b28b1fc53c9205761912b6a075 100644 (file)
@@ -222,5 +222,5 @@ HELP: cardinality
 { $description "Returns the number of elements in the set. All sets support this operation." } ;
 
 HELP: combine
-{ $values { "sets" "a sequence of sets" } { "set/f" { $maybe unordered-set } } }
+{ $values { "sets" { $sequence unordered-set } } { "set/f" { $maybe unordered-set } } }
 { $description "Outputs the union of a sequence of sets, or " { $link f } " if the sequence is empty." } ;
index 0bb903870ec21eda1b06d59e8660b6dbd7820f55..b17271315424539ab6961e787fccc076866dcd1b 100644 (file)
@@ -158,7 +158,7 @@ HELP: define-slot-methods
 $low-level-note ;
 
 HELP: define-accessors
-{ $values { "class" class } { "specs" "a sequence of " { $link slot-spec } " instances" } }
+{ $values { "class" class } { "specs" { $sequence slot-spec } } }
 { $description "Defines slot methods." }
 $low-level-note ;
 
@@ -173,5 +173,5 @@ HELP: set-slot
 { $warning "This word is in the " { $vocab-link "slots.private" } " vocabulary because it does not perform type or bounds checks, and slot numbers are implementation detail." } ;
 
 HELP: slot-named
-{ $values { "name" string } { "specs" "a sequence of " { $link slot-spec } " instances" } { "spec/f" { $maybe slot-spec } } }
+{ $values { "name" string } { "specs" { $sequence slot-spec } } { "spec/f" { $maybe slot-spec } } }
 { $description "Outputs the " { $link slot-spec } " with the given name." } ;
index 22d17b57d33f27674b962b64ed601b8ecfde1fdf..ddf887ce829914864ed06cd7f30a7d2aa71878c5 100644 (file)
@@ -44,7 +44,7 @@ HELP: sort-values
 { $description "Sorts the elements of " { $snippet "obj" } " (converting to an alist first if not a sequence), comparing second elements of pairs using the " { $link <=> } " word." } ;
 
 HELP: natural-sort
-{ $values { "seq" "a sequence of real numbers" } { "sortedseq" "a new sorted sequence" } }
+{ $values { "seq" sequence } { "sortedseq" "a new sorted sequence" } }
 { $description "Sorts a sequence of objects in natural order using the " { $link <=> } " word." } ;
 
 HELP: sort-pair
index b0bc88b17b5822f84b3b1efea7c6d317f03fdf48..887aec414af4a25e45b287a039d00982956c58bd 100644 (file)
@@ -93,7 +93,7 @@ HELP: ?tail-slice
 { $description "Like " { $link ?tail } ", except the resulting sequence is a " { $link slice } "." } ;
 
 HELP: string-lines
-{ $values { "str" string } { "seq" "a sequence of strings" } }
+{ $values { "str" string } { "seq" { $sequence string } } }
 { $description "Splits a string along line breaks." }
 { $examples
     { $example "USING: prettyprint splitting ;" "\"Hello\\r\\nworld\\n\" string-lines ." "{ \"Hello\" \"world\" }" }
index 571b7597be3945d647cb127e29c56a4b6e894455..17fa4ab8c438274f4a12db897fe641d70930d006 100644 (file)
@@ -48,7 +48,7 @@ HELP: 1string
 { $description "Outputs a string of one character." } ;
 
 HELP: >string
-{ $values { "seq" "a sequence of characters" } { "str" string } }
+{ $values { "seq" { $sequence "characters" } } { "str" string } }
 { $description "Outputs a freshly-allocated string with the same elements as a given sequence, by interpreting the sequence elements as Unicode code points." }
 { $notes "This operation is only appropriate if the underlying sequence holds Unicode code points, which is rare unless it is a " { $link slice } " of another string. To convert a sequence of bytes to a string, use the words documented in " { $link "io.encodings.string" } "." }
 { $errors "Throws an error if the sequence contains elements other than integers." } ;
index e2ed136ebd588dd1ac23a68d31cd9e1a5e33bf49..e3e285d11d82f13b2f909b3c8c6ca644275f3f04 100644 (file)
@@ -453,7 +453,7 @@ HELP: SYMBOL:
 
 HELP: SYMBOLS:
 { $syntax "SYMBOLS: words... ;" }
-{ $values { "words" "a sequence of new words to define" } }
+{ $values { "words" { $sequence "new words to define" } } }
 { $description "Creates a new symbol for every token until the " { $snippet ";" } "." }
 { $examples { $example "USING: prettyprint ;" "IN: scratchpad" "SYMBOLS: foo bar baz ;\nfoo . bar . baz ." "foo\nbar\nbaz" } } ;
 
@@ -471,7 +471,7 @@ HELP: SINGLETON:
 
 HELP: SINGLETONS:
 { $syntax "SINGLETONS: words... ;" }
-{ $values { "words" "a sequence of new words to define" } }
+{ $values { "words" { $sequence "new words to define" } } }
 { $description "Creates a new singleton for every token until the " { $snippet ";" } "." } ;
 
 HELP: ALIAS:
index 1088baf9a55eae724e8d7d5f313f9b4c98003111..b1f1796e1495d2a409fa0c9e24894356322e5be3 100755 (executable)
@@ -113,7 +113,7 @@ HELP: reload
 { $errors "Throws a " { $link no-vocab } " error if the vocabulary does not exist on disk." } ;
 
 HELP: require-when
-{ $values { "if" "a sequence of vocabulary specifiers" } { "then" "a vocabulary specifier" } }
+{ $values { "if" { $sequence "vocabulary specifiers" } } { "then" "a vocabulary specifier" } }
 { $description "Loads the " { $snippet "then" } " vocabulary if it is not loaded and all of the " { $snippet "if" } " vocabulary is. If some of the " { $snippet "if" } " vocabularies are not loaded now, but they are later, then the " { $snippet "then" } " vocabulary will be loaded along with the final one." }
 { $notes "This is used to express a joint dependency of vocabularies. If vocabularies " { $snippet "a" } " and " { $snippet "b" } " use code in vocabulary " { $snippet "c" } " to interact, then the following line, which can be placed in " { $snippet "a" } " or " { $snippet "b" } ", expresses the dependency."
 { $code "{ \"a\" \"b\" } \"c\" require-when" } } ;
index 0ab0a1c8ab4a0e4a3ef6b8d28fe473b3c0c6d37d..8a8460b2ed0b34ed3a61b30efc953f1e3efe94f5 100644 (file)
@@ -261,7 +261,7 @@ HELP: remove-word-prop
 { $side-effects "word" } ;
 
 HELP: remove-word-props
-{ $values { "word" word } { "seq" "a sequence of word property names" } }
+{ $values { "word" word } { "seq" { $sequence "word property names" } } }
 { $description "Removes all listed word properties from the word." }
 { $side-effects "word" } ;