From: John Benediktsson Date: Tue, 14 Jul 2015 22:57:18 +0000 (-0700) Subject: Use $sequence in a few places. X-Git-Tag: unmaintained~2470 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=94ed98e78c265b64f5f9eba8e8716d0d96da62b6 Use $sequence in a few places. --- diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 308509d8ac..fae8448228 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -661,7 +661,7 @@ HELP: prefix } ; HELP: sum-lengths -{ $values { "seq" "a sequence of sequences" } { "n" integer } } +{ $values { "seq" { $sequence sequence } } { "n" integer } } { $description "Outputs the sum of the lengths of all sequences in " { $snippet "seq" } "." } ; HELP: concat @@ -1124,20 +1124,20 @@ HELP: unclip-last-slice { $description "Outputs a head sequence and the last element of " { $snippet "seq" } "; the head sequence consists of all elements of " { $snippet "seq" } " but the last Unlike " { $link unclip-last } ", this word does not make a copy of the input sequence, and runs in constant time." } ; HELP: sum -{ $values { "seq" "a sequence of numbers" } { "n" number } } +{ $values { "seq" { $sequence number } } { "n" number } } { $description "Outputs the sum of all elements of " { $snippet "seq" } ". Outputs zero given an empty sequence." } ; HELP: product -{ $values { "seq" "a sequence of numbers" } { "n" number } } +{ $values { "seq" { $sequence number } } { "n" number } } { $description "Outputs the product of all elements of " { $snippet "seq" } ". Outputs one given an empty sequence." } ; HELP: infimum -{ $values { "seq" "a sequence of real numbers" } { "elt" object } } +{ $values { "seq" sequence } { "elt" object } } { $description "Outputs the least element of " { $snippet "seq" } "." } { $errors "Throws an error if the sequence is empty." } ; HELP: supremum -{ $values { "seq" "a sequence of real numbers" } { "elt" object } } +{ $values { "seq" sequence } { "elt" object } } { $description "Outputs the greatest element of " { $snippet "seq" } "." } { $errors "Throws an error if the sequence is empty." } ; diff --git a/core/vocabs/parser/parser-docs.factor b/core/vocabs/parser/parser-docs.factor index 3a59a59e52..85f5614823 100644 --- a/core/vocabs/parser/parser-docs.factor +++ b/core/vocabs/parser/parser-docs.factor @@ -147,12 +147,12 @@ HELP: add-qualified { $notes "If adding the vocabulary introduces ambiguity, the vocabulary will take precedence when resolving any ambiguous names. See the example in " { $link POSTPONE: QUALIFIED: } " for further explanation." } ; HELP: add-words-from -{ $values { "vocab" "a vocabulary specifier" } { "words" "a sequence of word names" } } +{ $values { "vocab" "a vocabulary specifier" } { "words" { $sequence "word names" } } } { $description "Adds " { $snippet "words" } " from " { $snippet "vocab" } " to the current manifest." } { $notes "This word is used to implement " { $link POSTPONE: FROM: } "." } ; HELP: add-words-excluding -{ $values { "vocab" "a vocabulary specifier" } { "words" "a sequence of word names" } } +{ $values { "vocab" "a vocabulary specifier" } { "words" { $sequence "word names" } } } { $description "Adds all words except for " { $snippet "words" } " from " { $snippet "vocab" } " to the manifest." } { $notes "This word is used to implement " { $link POSTPONE: EXCLUDE: } "." } ; diff --git a/core/vocabs/vocabs-docs.factor b/core/vocabs/vocabs-docs.factor index 55894351aa..06241a2f82 100644 --- a/core/vocabs/vocabs-docs.factor +++ b/core/vocabs/vocabs-docs.factor @@ -48,7 +48,7 @@ HELP: dictionary { $var-description "Holds a hashtable mapping vocabulary names to vocabularies." } ; HELP: loaded-vocab-names -{ $values { "seq" "a sequence of strings" } } +{ $values { "seq" { $sequence string } } } { $description "Outputs a sequence of all defined vocabulary names." } ; HELP: lookup-vocab @@ -67,11 +67,11 @@ HELP: vocab-words-assoc { $description "Outputs the words defined in a vocabulary." } ; HELP: vocab-words -{ $values { "vocab-spec" vocab-spec } { "seq" "a sequence of words" } } +{ $values { "vocab" string } { "seq" { $sequence word } } } { $description "Outputs a sequence of words defined in the vocabulary, or " { $link f } " if no vocabulary with this name exists." } ; HELP: all-words -{ $values { "seq" "a sequence of words" } } +{ $values { "seq" { $sequence word } } } { $description "Outputs a sequence of all words in the dictionary." } ; HELP: forget-vocab @@ -88,7 +88,7 @@ HELP: require { $notes "To unconditionally reload a vocabulary, use " { $link reload } ". To reload changed source files only, use the words in " { $link "vocabs.refresh" } "." } ; HELP: words-named -{ $values { "str" string } { "seq" "a sequence of words" } } +{ $values { "str" string } { "seq" { $sequence word } } } { $description "Outputs a sequence of all words named " { $snippet "str" } " from the set of currently-loaded vocabularies." } ; HELP: create-vocab @@ -96,7 +96,7 @@ HELP: create-vocab { $description "Creates a new vocabulary if one does not exist with the given name, otherwise outputs an existing vocabulary." } ; HELP: loaded-child-vocab-names -{ $values { "vocab-spec" "a vocabulary specifier" } { "seq" "a sequence of strings" } } +{ $values { "vocab-spec" "a vocabulary specifier" } { "seq" { $sequence string } } } { $description "Outputs all vocabularies which are conceptually under " { $snippet "vocab" } " in the hierarchy." } { $examples { $unchecked-example