From cea47b896d1e18ae5de010caf7b49be9ba549580 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 26 May 2014 07:51:19 -0700 Subject: [PATCH] more doc types. --- basis/math/vectors/vectors-docs.factor | 20 ++++++++++---------- core/namespaces/namespaces-docs.factor | 7 +++---- core/parser/parser-docs.factor | 4 ++-- core/sequences/sequences-docs.factor | 8 ++++---- extra/bitcoin/client/client-docs.factor | 2 +- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/basis/math/vectors/vectors-docs.factor b/basis/math/vectors/vectors-docs.factor index 56a3f390b9..9859f643eb 100644 --- a/basis/math/vectors/vectors-docs.factor +++ b/basis/math/vectors/vectors-docs.factor @@ -215,45 +215,45 @@ HELP: vtruncate { $description "Truncates each element of " { $snippet "u" } "." } ; HELP: n+v -{ $values { "n" "a number" } { "v" "a sequence of numbers" } { "w" "a sequence of numbers" } } +{ $values { "n" number } { "v" "a sequence of numbers" } { "w" "a sequence of numbers" } } { $description "Adds " { $snippet "n" } " to each element of " { $snippet "v" } "." } ; HELP: v+n -{ $values { "u" "a sequence of numbers" } { "n" "a number" } { "w" "a sequence of numbers" } } +{ $values { "u" "a sequence of numbers" } { "n" number } { "w" "a sequence of numbers" } } { $description "Adds " { $snippet "n" } " to each element of " { $snippet "u" } "." } ; HELP: n-v -{ $values { "n" "a number" } { "v" "a sequence of numbers" } { "w" "a sequence of numbers" } } +{ $values { "n" number } { "v" "a sequence of numbers" } { "w" "a sequence of numbers" } } { $description "Subtracts each element of " { $snippet "v" } " from " { $snippet "n" } "." } ; HELP: v-n -{ $values { "u" "a sequence of numbers" } { "n" "a number" } { "w" "a sequence of numbers" } } +{ $values { "u" "a sequence of numbers" } { "n" number } { "w" "a sequence of numbers" } } { $description "Subtracts " { $snippet "n" } " from each element of " { $snippet "u" } "." } ; HELP: n*v -{ $values { "n" "a number" } { "v" "a sequence of numbers" } { "w" "a sequence of numbers" } } +{ $values { "n" number } { "v" "a sequence of numbers" } { "w" "a sequence of numbers" } } { $description "Multiplies each element of " { $snippet "v" } " by " { $snippet "n" } "." } ; HELP: v*n -{ $values { "u" "a sequence of numbers" } { "n" "a number" } { "w" "a sequence of numbers" } } +{ $values { "u" "a sequence of numbers" } { "n" number } { "w" "a sequence of numbers" } } { $description "Multiplies each element of " { $snippet "u" } " by " { $snippet "n" } "." } ; HELP: n/v -{ $values { "n" "a number" } { "v" "a sequence of numbers" } { "w" "a sequence of numbers" } } +{ $values { "n" number } { "v" "a sequence of numbers" } { "w" "a sequence of numbers" } } { $description "Divides " { $snippet "n" } " by each element of " { $snippet "v" } "." } { $errors "May throw an error if a division by zero occurs; see " { $link "division-by-zero" } "." } ; HELP: v/n -{ $values { "u" "a sequence of numbers" } { "n" "a number" } { "w" "a sequence of numbers" } } +{ $values { "u" "a sequence of numbers" } { "n" number } { "w" "a sequence of numbers" } } { $description "Divides each element of " { $snippet "u" } " by " { $snippet "n" } "." } { $errors "May throw an error if a division by zero occurs; see " { $link "division-by-zero" } "." } ; HELP: n^v -{ $values { "n" "a number" } { "v" "a sequence of numbers" } { "w" "a sequence of numbers" } } +{ $values { "n" number } { "v" "a sequence of numbers" } { "w" "a sequence of numbers" } } { $description "Raises " { $snippet "n" } " to the power of each element of " { $snippet "v" } "." } ; HELP: v^n -{ $values { "u" "a sequence of numbers" } { "n" "a number" } { "w" "a sequence of numbers" } } +{ $values { "u" "a sequence of numbers" } { "n" number } { "w" "a sequence of numbers" } } { $description "Raises each element of " { $snippet "u" } " to the power of " { $snippet "n" } "." } ; HELP: v+ diff --git a/core/namespaces/namespaces-docs.factor b/core/namespaces/namespaces-docs.factor index 11cc60bbc5..0c77bbb3ce 100644 --- a/core/namespaces/namespaces-docs.factor +++ b/core/namespaces/namespaces-docs.factor @@ -1,6 +1,5 @@ -USING: help.markup help.syntax kernel kernel.private -sequences words namespaces.private quotations vectors -math.parser math words.symbol assocs ; +USING: assocs help.markup help.syntax kernel math +namespaces.private quotations words words.symbol ; IN: namespaces ARTICLE: "namespaces-combinators" "Namespace combinators" @@ -107,7 +106,7 @@ HELP: with-global { $description "Runs the quotation in the global namespace." } ; HELP: +@ -{ $values { "n" "a number" } { "variable" "a variable, by convention a symbol" } } +{ $values { "n" number } { "variable" "a variable, by convention a symbol" } } { $description "Adds " { $snippet "n" } " to the value of the variable. A variable value of " { $link f } " is interpreted as being zero." } { $side-effects "variable" } { $examples diff --git a/core/parser/parser-docs.factor b/core/parser/parser-docs.factor index da5fd302cf..e391ddc704 100644 --- a/core/parser/parser-docs.factor +++ b/core/parser/parser-docs.factor @@ -149,13 +149,13 @@ HELP: no-word { $description "Throws a " { $link no-word-error } "." } ; HELP: parse-word -{ $values { "string" string } { "word" "a number" } } +{ $values { "string" string } { "word" word } } { $description "If " { $snippet "string" } " is a valid number literal, it is converted to a number, otherwise the current vocabulary search path is searched for a word named by the string." } { $errors "Throws an error if the token does not name a word, and does not parse as a number." } { $notes "This word is used to implement " { $link scan-word } "." } ; HELP: parse-datum -{ $values { "string" string } { "word/number" "a word or number" } } +{ $values { "string" string } { "word/number" { $or word number } } } { $description "If " { $snippet "string" } " is a valid number literal, it is converted to a number, otherwise the current vocabulary search path is searched for a word named by the string." } { $errors "Throws an error if the token does not name a word, and does not parse as a number." } { $notes "This word is used to implement " { $link ?scan-datum } " and " { $link scan-datum } "." } ; diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 7a129d571c..8ec71149c3 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -1020,20 +1020,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" "a number" } } +{ $values { "seq" "a sequence of numbers" } { "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" "a number" } } +{ $values { "seq" "a sequence of numbers" } { "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" } { "n" "a number" } } +{ $values { "seq" "a sequence of real numbers" } { "n" number } } { $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" } { "n" "a number" } } +{ $values { "seq" "a sequence of real numbers" } { "n" number } } { $description "Outputs the greatest element of " { $snippet "seq" } "." } { $errors "Throws an error if the sequence is empty." } ; diff --git a/extra/bitcoin/client/client-docs.factor b/extra/bitcoin/client/client-docs.factor index c4350a3d7c..212231b5c6 100644 --- a/extra/bitcoin/client/client-docs.factor +++ b/extra/bitcoin/client/client-docs.factor @@ -120,7 +120,7 @@ HELP: set-generate HELP: get-info { $values - { "result" "an assoc" } + { "result" assoc } } { $description "Returns an assoc containing server information."