]> gitweb.factorcode.org Git - factor.git/commitdiff
minor cleanup to some docs.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 13 May 2015 23:09:14 +0000 (16:09 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 13 May 2015 23:09:14 +0000 (16:09 -0700)
35 files changed:
basis/compiler/cfg/alias-analysis/alias-analysis-docs.factor
basis/compiler/cfg/block-joining/block-joining-docs.factor
basis/compiler/cfg/builder/builder-docs.factor
basis/compiler/cfg/gc-checks/gc-checks-docs.factor
basis/compiler/cfg/linear-scan/allocation/allocation-docs.factor
basis/compiler/cfg/linear-scan/allocation/state/state-docs.factor
basis/compiler/cfg/liveness/liveness-docs.factor
basis/compiler/cfg/representations/peephole/peephole-docs.factor
basis/compiler/cfg/save-contexts/save-contexts-docs.factor
basis/compiler/codegen/gc-maps/gc-maps-docs.factor
basis/compiler/tree/debugger/debugger-docs.factor
basis/compiler/tree/propagation/call-effect/call-effect-docs.factor
basis/cpu/architecture/architecture-docs.factor
basis/deques/deques-docs.factor
basis/dlists/dlists-docs.factor
basis/http/client/client-docs.factor
basis/prettyprint/backend/backend-docs.factor
basis/threads/threads-docs.factor
basis/ui/commands/commands-docs.factor
basis/ui/operations/operations-docs.factor
basis/vocabs/metadata/metadata-docs.factor
core/assocs/assocs-docs.factor
core/continuations/continuations-docs.factor
core/io/io-docs.factor
core/io/streams/c/c-docs.factor
core/layouts/layouts-docs.factor
core/math/math-docs.factor
core/math/parser/parser-docs.factor
core/namespaces/namespaces-docs.factor
core/sequences/sequences-docs.factor
core/sequences/sequences.factor
core/vectors/vectors-docs.factor
core/vocabs/loader/loader-docs.factor
core/words/words-docs.factor
unmaintained/alien/marshall/marshall-docs.factor

index 8d09150190c18a9e62f3fbfcf3e82cc992e61353..5168e40aa9500c5f3745ee26d0504f14430185d8 100644 (file)
@@ -1,10 +1,10 @@
-USING: compiler.cfg.instructions help.markup help.syntax ;
+USING: compiler.cfg.instructions help.markup help.syntax kernel ;
 IN: compiler.cfg.alias-analysis
 
 HELP: useless-compare?
 { $values
   { "insn" "a " { $link ##compare } " instruction" }
-  { "?" "a boolean" }
+  { "?" boolean }
 }
 { $description "Checks if the comparison instruction is required." } ;
 
index 3ff80b1be6b7f0e512ed60f4a14258f42d49e9af..aabdb7e32d7a10bc19791cf6ee09c5fd317a05aa 100644 (file)
@@ -1,8 +1,8 @@
-USING: compiler.cfg compiler.cfg.instructions help.markup help.syntax ;
+USING: compiler.cfg compiler.cfg.instructions help.markup help.syntax kernel ;
 IN: compiler.cfg.block-joining
 
 HELP: join-block?
-{ $values { "bb" basic-block } { "?" "a boolean" } }
+{ $values { "bb" basic-block } { "?" boolean } }
 { $description "Whether the block can be joined with its predecessor or not." } ;
 
 HELP: join-blocks
index f360f4f880580899ac863e2616ac7b0c91cd8131..6a8b781ac0c480ce06e934b072f9f73ec33d1811 100644 (file)
@@ -1,6 +1,6 @@
 USING: assocs compiler.cfg compiler.cfg.builder.blocks
-compiler.cfg.stacks.local compiler.tree help.markup help.syntax literals math
-multiline sequences vectors words ;
+compiler.cfg.stacks.local compiler.tree help.markup help.syntax
+kernel literals math multiline sequences vectors words ;
 IN: compiler.cfg.builder
 
 <<
@@ -72,8 +72,8 @@ HELP: emit-node
 HELP: trivial-branch?
 { $values
   { "nodes" "a " { $link sequence } " of " { $link node } " instances" }
-  { "value" "the pushed value or " { $link f } }
-  { "?" "a boolean" }
+  { "value" { $maybe "the pushed value" } }
+  { "?" boolean }
 }
 { $description "Checks whether nodes is a trivial branch or not. The branch is counted as trivial if all it does is push a literal value on the stack." }
 { $examples
index 71f353c86f9411905a672c6d948dc636590a067d..172d369ea4263c379484cad81e6c5da75519c267 100644 (file)
@@ -32,7 +32,7 @@ HELP: gc-check-offsets
 { $description "A basic block is divided into sections by " { $link ##call } " and " { $link ##phi } " instructions. For every section with at least one allocation, record the offset of its first instruction  in a sequence." } ;
 
 HELP: insert-gc-check?
-{ $values { "bb" basic-block } { "?" "a boolean" } }
+{ $values { "bb" basic-block } { "?" boolean } }
 { $description "Whether to insert a gc check in the block or not." } ;
 
 HELP: insert-gc-checks
index fde318a47d7265a9cedac3152b3734f0f8147b72..0f3de71a623d12ce249cb2c839f4ec5d4752ea92 100644 (file)
@@ -1,6 +1,6 @@
 USING: assocs compiler.cfg compiler.cfg.instructions
 compiler.cfg.linear-scan.allocation compiler.cfg.linear-scan.allocation.state
-compiler.cfg.linear-scan.live-intervals help.markup help.syntax sequences ;
+compiler.cfg.linear-scan.live-intervals help.markup help.syntax kernel sequences ;
 IN: compiler.cfg.linear-scan.allocation
 
 HELP: (allocate-registers)
@@ -27,7 +27,7 @@ HELP: spill-at-sync-point
 { $values
   { "sync-point" sync-point }
   { "live-interval" live-interval-state }
-  { "?" "a boolean" }
+  { "?" boolean }
 }
 { $description "Maybe spills the live-interval at the given sync point. If the interval was spilled, then " { $link f } " is put on the stack to indicate that the interval isn't live anymore, " { $link t } " otherwise." }
 { $see-also spill-at-sync-point? } ;
@@ -36,6 +36,6 @@ HELP: spill-at-sync-point?
 { $values
   { "sync-point" sync-point }
   { "live-interval" live-interval-state }
-  { "?" "a boolean" }
+  { "?" boolean }
 }
 { $description "If the live interval has a definition at a keep-dst? sync-point, don't spill." } ;
index f04cbb834b9795e902babce94e74454a7bfffac6..6b30670c563c453fd02d5257080a5a5ed7946632 100644 (file)
@@ -2,7 +2,7 @@ USING: assocs compiler.cfg compiler.cfg.instructions
 compiler.cfg.linear-scan.allocation
 compiler.cfg.linear-scan.allocation.spilling
 compiler.cfg.linear-scan.live-intervals cpu.architecture heaps help.markup
-help.syntax math sequences vectors ;
+help.syntax kernel math sequences vectors ;
 IN: compiler.cfg.linear-scan.allocation.state
 
 HELP: activate-intervals
@@ -66,7 +66,7 @@ HELP: progress
 { $see-also check-handled check-unhandled } ;
 
 HELP: register-available?
-{ $values { "new" live-interval-state } { "result" "a pair" } { "?" "a boolean" } }
+{ $values { "new" live-interval-state } { "result" "a pair" } { "?" boolean } }
 { $description "Whether the register in 'result' can be used for the given live interval." } ;
 
 HELP: registers
index fea54c076016f155013c163920e4b3cc54a363df..43507732414bf640eeaebaf38298b6c1ec318d48 100644 (file)
@@ -1,5 +1,5 @@
 USING: assocs compiler.cfg compiler.cfg.def-use compiler.cfg.instructions
-compiler.cfg.representations help.markup help.syntax ;
+compiler.cfg.representations help.markup help.syntax kernel ;
 IN: compiler.cfg.liveness
 
 HELP: base-pointers
@@ -31,7 +31,7 @@ HELP: live-in
 { $description "All the virtual registers that are live in a basic block." } ;
 
 HELP: live-in?
-{ $values { "vreg" "virtual register" } { "bb" basic-block } { "?" "a boolean" } }
+{ $values { "vreg" "virtual register" } { "bb" basic-block } { "?" boolean } }
 { $description "Whether the vreg is live in the block or not." } ;
 
 HELP: live-ins
@@ -39,7 +39,7 @@ HELP: live-ins
 { $see-also compute-live-sets } ;
 
 HELP: lookup-base-pointer
-{ $values { "vreg" "vreg" } { "vreg/f" "vreg or " { $link f } } }
+{ $values { "vreg" "vreg" } { "vreg/f" { $maybe "vreg" } } }
 { $description "Tries to figure out what the base pointer for a vreg is. Can't use cache here because of infinite recursion inside the quotation passed to cache" }
 { $see-also base-pointers } ;
 
index 89455a36fa8ee766643c5b87f09601facb234ea1..2a698acf1e9dfe73477933c1314fa59a198f23a4 100644 (file)
@@ -1,8 +1,8 @@
-USING: compiler.cfg.instructions help.markup help.syntax ;
+USING: compiler.cfg.instructions help.markup help.syntax kernel ;
 IN: compiler.cfg.representations.peephole
 
 HELP: convert-to-zero-vector?
-{ $values { "insn" insn } { "?" "a boolean" } }
+{ $values { "insn" insn } { "?" boolean } }
 { $description "When a literal zeroes/ones vector is unboxed, we replace the " { $link ##load-reference } " with a " { $link ##zero-vector } " or " { $link ##fill-vector } " instruction since this is more efficient." } ;
 
 
index 1902330a245ac35284afbbe3b447271cc2ed53cc..540a09e7ec0a62c69fabd04d6699303e64beb83c 100644 (file)
@@ -1,5 +1,5 @@
 USING: compiler.cfg compiler.cfg.instructions help.markup help.syntax
-math sequences ;
+math sequences kernel ;
 IN: compiler.cfg.save-contexts
 
 HELP: insert-save-contexts
@@ -8,7 +8,7 @@ HELP: insert-save-contexts
 { $see-also context-save-needed } ;
 
 HELP: insns-needs-save-context?
-{ $values { "insns" sequence } { "?" "a boolean" } }
+{ $values { "insns" sequence } { "?" boolean } }
 { $description "Whether to insert a " { $link ##save-context } " instruction in the given instruction sequence or not." }
 { $see-also context-save-needed } ;
 
index fca874cd4b0d442670c21b4ae3345d30237abcf3..cba9d7fcbe4ac601b3ec6962519b655a8652cd35 100644 (file)
@@ -59,7 +59,7 @@ HELP: gc-maps
 { $var-description "Variable that holds a sequence of " { $link gc-map } " tuples." } ;
 
 HELP: gc-map-needed?
-{ $values { "gc-map/f" "a " { $link gc-map } " or f" } { "?" "a boolean" } }
+{ $values { "gc-map/f" { $maybe gc-map } } { "?" boolean } }
 { $description "If all slots in the gc-map are empty, then it doesn't need to be emitted." } ;
 
 HELP: serialize-gc-maps
index 8ce7a1ad4d3c4ec02ff491d816d27e5bbce4aeff..70c7a0b15b8d91f516e293b0d80176e240c22408 100644 (file)
@@ -2,5 +2,5 @@ USING: compiler.tree help.markup help.syntax ;
 IN: compiler.tree.debugger
 
 HELP: #>r?
-{ $values { "#shuffle" #shuffle } { "?" "a boolean" } }
+{ $values { "#shuffle" #shuffle } { "?" boolean } }
 { $description "True if the #shuffle copies an item from the data stack to the retain stack." } ;
index 7493f23687b02e173475f8a26de7d63553eb2f38..aaab9b598a6cf9867baa0b38c5141b944a95e71d 100644 (file)
@@ -1,13 +1,13 @@
 USING: combinators.private compiler.units effects help.markup help.syntax
-quotations ;
+kernel quotations words ;
 IN: compiler.tree.propagation.call-effect
 
 HELP: already-inlined-quot?
-{ $values { "quot" quotation } { "?" "a boolean" } }
+{ $values { "quot" quotation } { "?" boolean } }
 { $description "Some bookkeeping to make sure that crap like [ dup curry call( quot -- ) ] dup curry call( quot -- ) ] doesn't hang the compiler." } ;
 
 HELP: cached-effect-valid?
-{ $values { "quot" quotation } { "?" "a boolean" } }
+{ $values { "quot" quotation } { "?" boolean } }
 { $description { $link t } " if the cached effect is valid." } ;
 
 HELP: call-effect-ic
@@ -23,11 +23,11 @@ HELP: call-effect-slow>quot
 { $description "Creates a quotation which wraps " { $link call-effect-unsafe } "." } ;
 
 HELP: call-effect-unsafe?
-{ $values { "quot" quotation } { "effect" effect } { "?" "a boolean" } }
+{ $values { "quot" quotation } { "effect" effect } { "?" boolean } }
 { $description "Checks if the given effect is safe with regards to the quotation." } ;
 
 HELP: update-inline-cache
-{ $values { "word/quot" "word or quotation" } { "ic" inline-cache } }
+{ $values { "word/quot" { $or word quotation } } { "ic" inline-cache } }
 { $description "Sets the inline caches " { $slot "value" } " to the given word/quot and updates its " { $slot "counter" } " to the value of the " { $link effect-counter } "." } ;
 
 ARTICLE: "compiler.tree.propagation.call-effect" "Expansions of call( and execute( words"
index 961614c933bb5102a34eedfd5a02245aecf00f75..de9bee0301a6fc238f2deb8e230dc8f9495d06c9 100644 (file)
@@ -259,7 +259,7 @@ HELP: %write-barrier
 { $examples { $unchecked-example $[ ex-%write-barrier ] } } ;
 
 HELP: test-instruction?
-{ $values { "?" "a boolean" } }
+{ $values { "?" boolean } }
 { $description "Does the current architecture have a test instruction? Used on x86 to rewrite some " { $link CMP } " instructions to less expensive " { $link TEST } "s." } ;
 
 HELP: fused-unboxing?
@@ -271,7 +271,7 @@ HELP: return-regs
 { $description "What registers that will be used for function return values of which class." } ;
 
 HELP: return-struct-in-registers?
-{ $values { "c-type" class } { "?" "a boolean" } }
+{ $values { "c-type" class } { "?" boolean } }
 { $description "Whether the size of the struct is so small that it will be returned in registers or not." } ;
 
 HELP: stack-cleanup
index 9773e7ceb53eed9212fe727b4073997613ea0ca5..cd90a357e76c62eb9d71736ba334105e77e15715 100644 (file)
@@ -72,7 +72,7 @@ HELP: peek-front
 { $errors "Throws an error if the deque is empty." } ;
 
 HELP: ?peek-front
-{ $values { "deque" deque } { "obj/f" "an object or " { $link f } } }
+{ $values { "deque" deque } { "obj/f" { $maybe object } } }
 { $description "A forgiving version of " { $link peek-front } ". If the deque is empty, returns " { $link f } "." } ;
 
 HELP: pop-front
@@ -95,7 +95,7 @@ HELP: peek-back
 { $errors "Throws an error if the deque is empty." } ;
 
 HELP: ?peek-back
-{ $values { "deque" deque } { "obj/f" "an object or " { $link f } } }
+{ $values { "deque" deque } { "obj/f" { $maybe object } } }
 { $description "A forgiving version of " { $link peek-back } ". If the deque is empty, returns " { $link f } "." } ;
 
 HELP: pop-back
index 8138feee6a0e4c01ace27d4ab71ab57d0dee6b5d..508116816aea1427d5306bade5eee7fe6f9cbb91 100644 (file)
@@ -40,7 +40,7 @@ HELP: <hashed-dlist>
 { $description "Creates a new " { $link search-deque } " backed by a " { $link dlist } ", with a " { $link hashtable } " for fast membership tests." } ;
 
 HELP: dlist-find
-{ $values { "dlist" { $link dlist } } { "quot" quotation } { "obj/f" "an object or " { $link f } } { "?" boolean } }
+{ $values { "dlist" { $link dlist } } { "quot" quotation } { "obj/f" { $maybe object } } { "?" boolean } }
 { $description "Applies the quotation to each element of the " { $link dlist } " in turn, until it outputs a true value or the end of the " { $link dlist } " is reached.  Outputs either the object it found or " { $link f } ", and a boolean which is true if an object is found." }
 { $notes "Returns a boolean to allow dlists to store " { $link f } "."
     $nl
@@ -58,12 +58,12 @@ HELP: dlist-any?
 { $notes "This operation is O(n)." } ;
 
 HELP: delete-node-if*
-{ $values { "dlist" { $link dlist } } { "quot" quotation } { "obj/f" "an object or " { $link f } } { "?" boolean } }
+{ $values { "dlist" { $link dlist } } { "quot" quotation } { "obj/f" { $maybe object } } { "?" boolean } }
 { $description "Calls " { $link dlist-find } " on the " { $link dlist } " and deletes the node returned, if any.  Returns the value of the deleted node and a boolean to allow the deleted value to distinguished from " { $link f } ", for nothing deleted." }
 { $notes "This operation is O(n)." } ;
 
 HELP: delete-node-if
-{ $values { "dlist" { $link dlist } } { "quot" quotation } { "obj/f" "an object or " { $link f } } }
+{ $values { "dlist" { $link dlist } } { "quot" quotation } { "obj/f" { $maybe object } } }
 { $description "Like " { $link delete-node-if* } " but cannot distinguish from deleting a node whose value is " { $link f } " or not deleting an element." }
 { $notes "This operation is O(n)." } ;
 
index 3628f9942b94d3de93fa0938b7c12c37b8273aec..e7b661b0384d1b0b6193e322e43ff01647658286 100644 (file)
@@ -11,112 +11,112 @@ HELP: too-many-redirects
 { $error-description "Thrown by " { $link http-request } " if the server returns a chain of than " { $link max-redirects } " redirections." } ;
 
 HELP: <get-request>
-{ $values { "url" "a " { $link url } " or " { $link string } } { "request" request } }
+{ $values { "url" { $or url string } } { "request" request } }
 { $description "Constructs an HTTP GET request for retrieving the URL." }
 { $notes "The request can be passed on to " { $link http-request } ", possibly after cookies and headers are set." } ;
 
 HELP: <post-request>
-{ $values { "post-data" object } { "url" "a " { $link url } " or " { $link string } } { "request" request } }
+{ $values { "post-data" object } { "url" { $or url string } } { "request" request } }
 { $description "Constructs an HTTP POST request for submitting post data to the URL." }
 { $notes "The request can be passed on to " { $link http-request } ", possibly after cookies and headers are set." } ;
 
 HELP: <head-request>
-{ $values { "url" "a " { $link url } " or " { $link string } } { "request" request } }
+{ $values { "url" { $or url string } } { "request" request } }
 { $description "Constructs an HTTP HEAD request for retrieving the URL." }
 { $notes "The request can be passed on to " { $link http-request } ", possibly after cookies and headers are set." } ;
 
 HELP: <delete-request>
-{ $values { "url" "a " { $link url } " or " { $link string } } { "request" request } }
+{ $values { "url" { $or url string } } { "request" request } }
 { $description "Constructs an HTTP DELETE request for the requested URL." }
 { $notes "The request can be passed on to " { $link http-request } ", possibly after cookies and headers are set." } ;
 
 HELP: <options-request>
-{ $values { "url" "a " { $link url } " or " { $link string } } { "request" request } }
+{ $values { "url" { $or url string } } { "request" request } }
 { $description "Constructs an HTTP OPTIONS request for the requested URL." }
 { $notes "The request can be passed on to " { $link http-request } ", possibly after cookies and headers are set." } ;
 
 HELP: <trace-request>
-{ $values { "url" "a " { $link url } " or " { $link string } } { "request" request } }
+{ $values { "url" { $or url string } } { "request" request } }
 { $description "Constructs an HTTP TRACE request for the requested URL." }
 { $notes "The request can be passed on to " { $link http-request } ", possibly after cookies and headers are set." } ;
 
 HELP: download
-{ $values { "url" "a " { $link url } " or " { $link string } } }
+{ $values { "url" { $or url string } } }
 { $description "Downloads the contents of the URL to a file in the " { $link current-directory } " having the same file name." }
 { $errors "Throws an error if the HTTP request fails." } ;
 
 HELP: download-to
-{ $values { "url" "a " { $link url } " or " { $link string } } { "file" "a pathname string" } }
+{ $values { "url" { $or url string } } { "file" "a pathname string" } }
 { $description "Downloads the contents of the URL to a file with the given pathname." }
 { $errors "Throws an error if the HTTP request fails." } ;
 
 HELP: ?download-to
-{ $values { "url" "a " { $link url } " or " { $link string } } { "file" "a pathname string" } }
+{ $values { "url" { $or url string } } { "file" "a pathname string" } }
 { $description "Version of " { $link download-to } " that only downloads if " { $snippet "file" } " does not exist." }
 { $errors "Throws an error if the HTTP request fails." } ;
 
 HELP: http-get
-{ $values { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Downloads the contents of a URL." }
 { $errors "Throws an error if the HTTP request fails." } ;
 
 HELP: http-get*
-{ $values { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Downloads the contents of a URL, but does not check the HTTP response code for success." } ;
 
 { http-get http-get* } related-words
 
 HELP: http-post
-{ $values { "post-data" object } { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "post-data" object } { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Submits an HTTP POST request." }
 { $errors "Throws an error if the HTTP request fails." } ;
 
 HELP: http-post*
-{ $values { "post-data" object } { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "post-data" object } { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Submits an HTTP POST request, but does not check the HTTP response code for success." } ;
 
 { http-post http-post* } related-words
 
 HELP: http-put
-{ $values { "post-data" object } { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "post-data" object } { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Submits an HTTP PUT request." }
 { $errors "Throws an error if the HTTP request fails." } ;
 
 HELP: http-put*
-{ $values { "post-data" object } { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "post-data" object } { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Submits an HTTP PUT request, but does not check the HTTP response code for success." } ;
 
 { http-put http-put* } related-words
 
 HELP: http-head
-{ $values { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Same as " { $link http-get } " except that the server is not supposed to return a message-body in the response, as per RFC2616. However in practise, most web servers respond to GET and HEAD method calls with identical responses." }
 { $errors "Throws an error if the HTTP request fails." } ;
 
 HELP: http-head*
-{ $values { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Same as " { $link http-get* } " except that the server is not supposed to return a message-body in the response, as per RFC2616. However in practise, most web servers respond to GET and HEAD method calls with identical responses." } ;
 
 { http-head http-head* } related-words
 
 HELP: http-delete
-{ $values { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Requests that the origin server delete the resource identified by the URL." }
 { $errors "Throws an error if the HTTP request fails." } ;
 
 HELP: http-delete*
-{ $values { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Requests that the origin server delete the resource identified by the URL, but does not check the HTTP response code for success." } ;
 
 { http-delete http-delete* } related-words
 
 HELP: http-options
-{ $values { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Submits an HTTP OPTIONS request." }
 { $errors "Throws an error if the HTTP request fails." } ;
 
 HELP: http-options*
-{ $values { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Submits an HTTP OPTIONS request, but does not check the HTTP response code for success." } ;
 
 { http-options http-options* } related-words
@@ -127,7 +127,7 @@ HELP: http-trace
 { $errors "Throws an error if the HTTP request fails." } ;
 
 HELP: http-trace*
-{ $values { "url" "a " { $link url } " or " { $link string } } { "response" response } { "data" sequence } }
+{ $values { "url" { $or url string } } { "response" response } { "data" sequence } }
 { $description "Submits an HTTP TRACE request, but does not check the HTTP response code for success." } ;
 
 { http-trace http-trace* } related-words
index 250fbe61b0043f3d479d4260ea668ababc9de233..e9b536a83f682fd9cdcaa7dcccd797732c6ba2df 100644 (file)
@@ -1,4 +1,4 @@
-USING: help.markup help.syntax kernel prettyprint.config
+USING: help.markup help.syntax kernel math prettyprint.config
 prettyprint.custom sequences strings words ;
 IN: prettyprint.backend
 
@@ -37,7 +37,7 @@ HELP: check-recursion
 $prettyprinting-note ;
 
 HELP: do-length-limit
-{ $values { "seq" sequence } { "trimmed" "a trimmed sequence" } { "n/f" "an integer or " { $link f } } }
+{ $values { "seq" sequence } { "trimmed" "a trimmed sequence" } { "n/f" { $maybe integer } } }
 { $description "If the " { $link length-limit } " is set and the sequence length exceeds this limit, trims the sequence and outputs a the number of elements which were chopped off the end. Otherwise outputs " { $link f } "." }
 $prettyprinting-note ;
 
index 7d58d6f635d96b3d36e65290f5044969caaa64fc..53e0e67711c47372aec07fda30f90e77614f83c6 100644 (file)
@@ -111,7 +111,7 @@ HELP: sleep-queue
 { $var-description "A " { $link min-heap } " storing the queue of sleeping threads." } ;
 
 HELP: sleep-time
-{ $values { "nanos/f" "a non-negative integer or " { $link f } } }
+{ $values { "nanos/f" { $maybe "a non-negative integer" } } }
 { $description "Returns the time until the next sleeping thread is scheduled to wake up, which could be zero if there are threads in the run queue, or threads which need to wake up right now. If there are no runnable or sleeping threads, returns " { $link f } "." } ;
 
 HELP: stop
@@ -121,7 +121,7 @@ HELP: yield
 { $description "Adds the current thread to the end of the run queue, and switches to the next runnable thread." } ;
 
 HELP: sleep-until
-{ $values { "n/f" "a non-negative integer or " { $link f } } }
+{ $values { "n/f" { $maybe "a non-negative integer" } } }
 { $description "Suspends the current thread until the given nanosecond count, returned by " { $link nano-count } ", is reached, or indefinitely if a value of " { $link f } " is passed in."
 $nl
 "Other threads may interrupt the sleep by calling " { $link interrupt } "." } ;
index 135ef00f8423ffbaaaa32dfef79a45c863798f7d..d3ed8156bca2c012c67ce77ad5e7c8133af04b63 100644 (file)
@@ -48,7 +48,7 @@ HELP: invoke-command
 { invoke-command +nullary+ } related-words
 
 HELP: command-name
-{ $values { "command" "a command" } { "str" "a string" } }
+{ $values { "command" "a command" } { "str" string } }
 { $description "Outputs a human-readable name for the command." }
 { $examples
     { $example
@@ -61,7 +61,7 @@ HELP: command-name
 } ;
 
 HELP: command-description
-{ $values { "command" "a command" } { "str/f" "a string or " { $link f } } }
+{ $values { "command" "a command" } { "str/f" { $maybe string } } }
 { $description "Outputs the command's description." } ;
 
 { command-description +description+ } related-words
index 26bf248174f60f4dc9d8e464b62328cbe13ebf7e..07ef9dd116b94454ee749015def393e700821717 100644 (file)
@@ -30,7 +30,7 @@ $nl
 } } ;
 
 HELP: operation-gesture
-{ $values { "operation" operation } { "gesture" "a gesture or " { $link f } } }
+{ $values { "operation" operation } { "gesture" { $maybe "a gesture" } } }
 { $description "Outputs the keyboard gesture associated with the operation." } ;
 
 HELP: operations
index c3dce45c09298d498239fa14b7287ad90f786f4d..f13c93379fd1a6e1d71465b9058506c80de57562 100644 (file)
@@ -45,7 +45,7 @@ ARTICLE: "vocabs.metadata" "Vocabulary metadata"
 ABOUT: "vocabs.metadata"
 
 HELP: vocab-file-contents
-{ $values { "vocab" "a vocabulary specifier" } { "name" string } { "seq" "a sequence of lines, or " { $link f } } }
+{ $values { "vocab" "a vocabulary specifier" } { "name" string } { "seq" { $maybe "a sequence of lines" } } }
 { $description "Outputs the contents of the file named " { $snippet "name" } " from the vocabulary's directory, or " { $link f } " if the file does not exist." } ;
 
 HELP: set-vocab-file-contents
@@ -53,11 +53,11 @@ HELP: set-vocab-file-contents
 { $description "Stores a sequence of lines to the file named " { $snippet "name" } " from the vocabulary's directory." } ;
 
 HELP: vocab-summary
-{ $values { "vocab" "a vocabulary specifier" } { "summary" "a string or " { $link f } } }
+{ $values { "vocab" "a vocabulary specifier" } { "summary" { $maybe string } } }
 { $description "Outputs a one-line string description of the vocabulary's intended purpose from the " { $snippet "summary.txt" } " file in the vocabulary's directory. Outputs " { $link f } " if the file does not exist." } ;
 
 HELP: set-vocab-summary
-{ $values { "string" "a string or " { $link f } } { "vocab" "a vocabulary specifier" } }
+{ $values { "string" { $maybe string } } { "vocab" "a vocabulary specifier" } }
 { $description "Stores a one-line string description of the vocabulary to the " { $snippet "summary.txt" } " file in the vocabulary's directory." } ;
 
 HELP: vocab-tags
index b7bd5713b1abd99224d309781e8ea433e1567355..96300ac86da3da873408df910db2d7d93ed32296 100644 (file)
@@ -360,16 +360,16 @@ 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" "a value or " { $link f } } }
+{ $values { "key" "a key" } { "seq" "a sequence of assocs" } { "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." } ;
 
 HELP: value-at*
-{ $values { "value" object } { "assoc" assoc } { "key/f" "the key associated to the value, or " { $link f } } { "?" boolean } }
+{ $values { "value" object } { "assoc" assoc } { "key/f" { $maybe "the key associated to the value" } } { "?" boolean } }
 { $description "Looks up the key associated with a value. The boolean flag can decide between the case of a missing key, and a key of " { $link f } "." } ;
 
 HELP: value-at
-{ $values { "value" object } { "assoc" assoc } { "key/f" "the key associated to the value, or " { $link f } } }
+{ $values { "value" object } { "assoc" assoc } { "key/f" { $maybe "the key associated to the value" } } }
 { $description "Looks up the key associated with a value. No distinction is made between a missing key and a key set to " { $link f } "." } ;
 
 HELP: value?
@@ -377,7 +377,7 @@ HELP: value?
 { $description "Tests if an assoc contains at least one key with the given value." } ;
 
 HELP: delete-at*
-{ $values { "key" "a key" } { "assoc" assoc } { "old" "the previous value or " { $link f } } { "?" boolean } }
+{ $values { "key" "a key" } { "assoc" assoc } { "old" { $maybe "the previous value" } } { "?" boolean } }
 { $description "Removes an entry from the assoc and outputs the previous value together with a boolean indicating whether it was present." }
 { $side-effects "assoc" } ;
 
index c86093507e81c10f9fff1a3a5525a0d38fe35967..ca58087a124e712f5448af5d6b760b4a330a5f69 100644 (file)
@@ -184,7 +184,7 @@ HELP: ignore-errors
 { $description "Calls the quotation. If an exception is thrown in the dynamic extent of the quotation, restores the data stack and returns." } ;
 
 HELP: in-callback?
-{ $values { "?" "a boolean" } }
+{ $values { "?" boolean } }
 { $description "t if Factor is currently executing a callback." } ;
 
 HELP: rethrow
index 67fb5757c121c12a6f896fc572230374a125b985..1e0267544ae1905ca005f308f9c9819b0472c5fa 100644 (file)
@@ -27,13 +27,13 @@ HELP: stream-element-type
 { $contract "Outputs one of " { $link +byte+ } " or " { $link +character+ } "." } ;
 
 HELP: stream-readln
-{ $values { "stream" "an input stream" } { "str/f" "a string or " { $link f } } }
+{ $values { "stream" "an input stream" } { "str/f" { $maybe string } } }
 { $contract "Reads a line of input from the stream. Outputs " { $link f } " on stream exhaustion." }
 { $notes "Most code only works on one stream at a time and should instead use " { $link readln } "; see " { $link "stdio" } "." }
 $io-error ;
 
 HELP: stream-read1
-{ $values { "stream" "an input stream" } { "elt" "an element or " { $link f } } }
+{ $values { "stream" "an input stream" } { "elt" { $maybe "an element" } } }
 { $contract "Reads an element from the stream. Outputs " { $link f } " on stream exhaustion." }
 { $notes "Most code only works on one stream at a time and should instead use " { $link read1 } "; see " { $link "stdio" } "." }
 $io-error ;
@@ -62,7 +62,7 @@ HELP: stream-read-into
 $io-error ;
 
 HELP: stream-read-until
-{ $values { "seps" string } { "stream" "an input stream" } { "seq" { $or byte-array string f } } { "sep/f" "a character or " { $link f } } }
+{ $values { "seps" string } { "stream" "an input stream" } { "seq" { $or byte-array string f } } { "sep/f" { $maybe "a character" } } }
 { $contract "Reads elements from the stream, until the first occurrence of a separator character, or stream exhaustion. In the former case, the separator is pushed on the stack, and is not part of the output string. In the latter case, the entire stream contents are output, along with " { $link f } "." }
 { $notes "Most code only works on one stream at a time and should instead use " { $link read-until } "; see " { $link "stdio" } "." }
 $io-error ;
@@ -157,7 +157,7 @@ HELP: stream-seekable?
 
 HELP: stream-length
 { $values
-     { "stream" "a stream" } { "n/f" "an integer or " { $link f } }
+     { "stream" "a stream" } { "n/f" { $maybe integer } }
 }
 { $description "Returns the length of the data supplied by " { $snippet "stream" } ", or " { $link f } " if the stream is not seekable or has unknown length." }
 { $notes "Stream seeking is not supported on streams that do not have a known length, e.g. TCP/IP streams." } ;
@@ -208,12 +208,12 @@ HELP: error-stream
 { $var-description "Holds an error stream." } ;
 
 HELP: readln
-{ $values { "str/f" "a string or " { $link f } } }
+{ $values { "str/f" { $maybe string } } }
 { $description "Reads a line of input from " { $link input-stream } ". Outputs " { $link f } " on stream exhaustion." }
 $io-error ;
 
 HELP: read1
-{ $values { "elt" "an element or " { $link f } } }
+{ $values { "elt" { $maybe "an element" } } }
 { $description "Reads an element from " { $link input-stream } ". Outputs " { $link f } " on stream exhaustion." }
 $io-error ;
 
@@ -223,7 +223,7 @@ HELP: read
 $io-error ;
 
 HELP: read-until
-{ $values { "seps" string } { "seq" { $or byte-array string f } } { "sep/f" "a character or " { $link f } } }
+{ $values { "seps" string } { "seq" { $or byte-array string f } } { "sep/f" { $maybe "a character" } } }
 { $contract "Reads elements from " { $link input-stream } " until the first occurrence of a separator, or stream exhaustion. In the former case, the separator character is pushed on the stack, and is not part of the output. In the latter case, the entire stream contents are output, along with " { $link f } "." }
 $io-error ;
 
index 531cc9678e737fa11cae38cfc60feeecaa36e144..bd87d80295e28646fbf82c55d25ba9d5b9a8721b 100644 (file)
@@ -58,7 +58,7 @@ HELP: fclose
 { $description "Closes a C FILE* handle." } ;
 
 HELP: fgetc
-{ $values { "alien" "a C FILE* handle" } { "byte/f" "an integer from 0 to 255 or " { $link f } } }
+{ $values { "alien" "a C FILE* handle" } { "byte/f" { $maybe "an integer from 0 to 255" } } }
 { $description "Reads a single byte from a C FILE* handle, and outputs " { $link f } " on end of file." } 
 { $errors "Throws an error if the input operation failed." } ;
 
index d330f52519e3fa362232ca62f5015414903002ee..4d6d3e6e31c0a20eb798bdeff061e0f6fce214de 100644 (file)
@@ -14,7 +14,7 @@ HELP: num-types
 { $var-description "Number of distinct built-in types. This is one more than the maximum value from the " { $link tag } " primitive." } ;
 
 HELP: type-number
-{ $values { "class" class } { "n" "an integer or " { $link f } } }
+{ $values { "class" class } { "n" { $maybe integer  } } }
 { $description "Outputs the built-in type number instances of " { $link class } ". Will output " { $link f } " if this is not a built-in class." }
 { $see-also builtin-class } ;
 
index befa11c7e11d291fd28a005888c3028bc072f43c..2c434cff83976dc0b45cfe378b5393592b13b2b9 100644 (file)
@@ -423,12 +423,12 @@ HELP: all-integers?
 { $notes "This word is used to implement " { $link all? } "." } ;
 
 HELP: find-integer
-{ $values { "n" integer } { "quot" { $quotation ( ... i -- ... ? ) } } { "i" "an integer or " { $link f } } }
+{ $values { "n" integer } { "quot" { $quotation ( ... i -- ... ? ) } } { "i" { $maybe integer } } }
 { $description "Applies the quotation to each integer from 0 up to " { $snippet "n" } ", excluding " { $snippet "n" } ". Iteration stops when the quotation outputs a true value or the end is reached. If the quotation yields a true value for some integer, this word outputs that integer. Otherwise, this word outputs " { $link f } "." }
 { $notes "This word is used to implement " { $link find } "." } ;
 
 HELP: find-last-integer
-{ $values { "n" integer } { "quot" { $quotation ( ... i -- ... ? ) } } { "i" "an integer or " { $link f } } }
+{ $values { "n" integer } { "quot" { $quotation ( ... i -- ... ? ) } } { "i" { $maybe integer } } }
 { $description "Applies the quotation to each integer from " { $snippet "n" } " down to 0, inclusive. Iteration stops when the quotation outputs a true value or 0 is reached. If the quotation yields a true value for some integer, the word outputs that integer. Otherwise, the word outputs " { $link f } "." }
 { $notes "This word is used to implement " { $link find-last } "." } ;
 
index fb200ce60c43fcc86f8fcf9527ba1dcec4c44d3c..9cefe5231990d807ea565ad88e56dd97a11a76bc 100644 (file)
@@ -44,7 +44,7 @@ HELP: digit>
 { $notes "This is one of the factors of " { $link string>number } "." } ;
 
 HELP: base>
-{ $values { "str" string } { "radix" "an integer between 2 and 16" } { "n/f" "a real number or " { $link f } } }
+{ $values { "str" string } { "radix" "an integer between 2 and 16" } { "n/f" { $maybe real } } }
 { $description "Creates a real number from a string representation with the given radix. The radix for floating point literals can be either base 10 or base 16."
 $nl
 "Outputs " { $link f } " if the string does not represent a number." } ;
@@ -52,7 +52,7 @@ $nl
 { >base base> } related-words
 
 HELP: string>number
-{ $values { "str" string } { "n/f" "a real number or " { $link f } } }
+{ $values { "str" string } { "n/f" { $maybe real } } }
 { $description "Creates a real number from a string representation of a number in base 10."
 $nl
 "Outputs " { $link f } " if the string does not represent a number." } ;
@@ -60,7 +60,7 @@ $nl
 { string>number number>string } related-words
 
 HELP: bin>
-{ $values { "str" string } { "n/f" "a real number or " { $link f } } }
+{ $values { "str" string } { "n/f" { $maybe real } } }
 { $description "Creates a real number from a string representation of a number in base 2."
 $nl
 "Outputs " { $link f } " if the string does not represent a number." } ;
@@ -68,7 +68,7 @@ $nl
 { >bin bin> .b } related-words
 
 HELP: oct>
-{ $values { "str" string } { "n/f" "a real number or " { $link f } } }
+{ $values { "str" string } { "n/f" { $maybe real } } }
 { $description "Creates a real number from a string representation of a number in base 8."
 $nl
 "Outputs " { $link f } " if the string does not represent a number." } ;
@@ -76,7 +76,7 @@ $nl
 { >oct oct> .o } related-words
 
 HELP: hex>
-{ $values { "str" string } { "n/f" "a real number or " { $link f } } }
+{ $values { "str" string } { "n/f" { $maybe real } } }
 { $description "Creates a real number from a string representation of a number in base 16."
 $nl
 "Outputs " { $link f } " if the string does not represent a number." } ;
index 0c77bbb3ce2fd0521ff3027665543fcd848334e5..0b2928f5b1833342bdec7b482512776614a975f6 100644 (file)
@@ -65,7 +65,7 @@ $nl
 ABOUT: "namespaces"
 
 HELP: get
-{ $values { "variable" "a variable, by convention a symbol" } { "value" "the value, or " { $link f } } }
+{ $values { "variable" "a variable, by convention a symbol" } { "value" { $maybe "the value" } } }
 { $description "Searches the name stack for a namespace containing the variable, and outputs the associated value. If no such namespace is found, outputs " { $link f } "." } ;
 
 HELP: set
index 9504b360c449e53515683a4693cbad8afa5339a0..308509d8ac32da17ae35e35e81f6056115948f5a 100644 (file)
@@ -166,16 +166,16 @@ HELP: bounds-check?
 { $description "Tests if the index is within the bounds of the sequence." } ;
 
 HELP: bounds-error
-{ $values { "n" "a positive integer" } { "seq" sequence } }
+{ $values { "n" integer } { "seq" sequence } }
 { $description "Throws a " { $link bounds-error } "." }
 { $error-description "Thrown by " { $link nth } ", " { $link set-nth } " and " { $link set-length } " if the given index lies beyond the bounds of the sequence." } ;
 
 HELP: bounds-check
-{ $values { "n" "a positive integer" } { "seq" sequence } }
+{ $values { "n" integer } { "seq" sequence } }
 { $description "Throws an error if " { $snippet "n" } " is negative or if it is greater than or equal to the length of " { $snippet "seq" } ". Otherwise the two inputs remain on the stack." } ;
 
 HELP: ?nth
-{ $values { "n" integer } { "seq" sequence } { "elt/f" "an object or " { $link f } } }
+{ $values { "n" integer } { "seq" sequence } { "elt/f" { $maybe object } } }
 { $description "A forgiving version of " { $link nth } ". If the index is out of bounds, or if the sequence is " { $link f } ", simply outputs " { $link f } "." } ;
 
 HELP: ?set-nth
@@ -183,7 +183,7 @@ HELP: ?set-nth
 { $description "A forgiving version of " { $link set-nth } ".  If the index is out of bounds, does nothing." } ;
 
 HELP: ?first
-{ $values { "seq" sequence } { "elt/f" "an object or " { $link f } } }
+{ $values { "seq" sequence } { "elt/f" { $maybe object } } }
 { $description "A forgiving version of " { $link first } ". If the sequence is empty, or if the sequence is " { $link f } ", simply outputs " { $link f } "." }
 { $examples
     "On an empty sequence:"
@@ -200,11 +200,11 @@ HELP: ?first
 
 
 HELP: ?second
-{ $values { "seq" sequence } { "elt/f" "an object or " { $link f } } }
+{ $values { "seq" sequence } { "elt/f" { $maybe object } } }
 { $description "A forgiving version of " { $link second } ". If the sequence has less than two elements, or if the sequence is " { $link f } ", simply outputs " { $link f } "." } ;
 
 HELP: ?last
-{ $values { "seq" sequence } { "elt/f" "an object or " { $link f } } }
+{ $values { "seq" sequence } { "elt/f" { $maybe object } } }
 { $description "A forgiving version of " { $link last } ". If the sequence is empty, or if the sequence is " { $link f } ", simply outputs " { $link f } "." } ;
 
 HELP: nth-unsafe
@@ -456,35 +456,35 @@ HELP: find-from
 { $values { "n" "a starting index" }
           { "seq" sequence }
           { "quot" { $quotation ( ... elt -- ... ? ) } }
-          { "i" "the index of the first match, or " { $link f } }
-          { "elt" "the first matching element, or " { $link f } } }
+          { "i" { $maybe "the index of the first match" } }
+          { "elt" { $maybe "the first matching element" } } }
 { $description "Applies the quotation to each element of the sequence in turn, until it outputs a true value or the end of the sequence is reached. If the quotation yields a true value for some sequence element, the word outputs the element index and the element itself. Otherwise, the word outputs an index of " { $link f } " and " { $link f } " as the element." } ;
 
 HELP: find-last
-{ $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... ? ) } } { "i" "the index of the first match, or f" } { "elt" "the first matching element, or " { $link f } } }
+{ $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... ? ) } } { "i" { $maybe "the index of the first match" } } { "elt" { $maybe "the first matching element" } } }
 { $description "A simpler variant of " { $link find-last-from } " where the starting index is one less than the length of the sequence." } ;
 
 HELP: find-last-from
-{ $values { "n" "a starting index" } { "seq" sequence } { "quot" { $quotation ( ... elt -- ... ? ) } } { "i" "the index of the first match, or f" } { "elt" "the first matching element, or " { $link f } } }
+{ $values { "n" "a starting index" } { "seq" sequence } { "quot" { $quotation ( ... elt -- ... ? ) } } { "i" { $maybe "the index of the first match" } } { "elt" { $maybe "the first matching element" } } }
 { $description "Applies the quotation to each element of the sequence in reverse order, until it outputs a true value or the start of the sequence is reached. If the quotation yields a true value for some sequence element, the word outputs the element index and the element itself. Otherwise, the word outputs an index of " { $link f } " and " { $link f } " as the element." } ;
 
 HELP: find-index
 { $values { "seq" sequence }
           { "quot" { $quotation ( ... elt i -- ... ? ) } }
-          { "i" "the index of the first match, or " { $link f } }
-          { "elt" "the first matching element, or " { $link f } } }
+          { "i" { $maybe "the index of the first match" } }
+          { "elt" { $maybe "the first matching element" } } }
 { $description "A varient of " { $link find } " where the quotation takes both an element and its index." } ;
 
 HELP: find-index-from
 { $values { "n" "a starting index" }
           { "seq" sequence }
           { "quot" { $quotation ( ... elt i -- ... ? ) } }
-          { "i" "the index of the first match, or " { $link f } }
-          { "elt" "the first matching element, or " { $link f } } }
+          { "i" { $maybe "the index of the first match" } }
+          { "elt" { $maybe "the first matching element" } } }
 { $description "A varient of " { $link find-from } " where the quotation takes both an element and its index." } ;
 
 HELP: map-find
-{ $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... result/f ) } } { "result" "the first non-false result of the quotation" } { "elt" "the first matching element, or " { $link f } } }
+{ $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... result/f ) } } { "result" "the first non-false result of the quotation" } { "elt" { $maybe "the first matching element" } } }
 { $description "Applies the quotation to each element of the sequence, until the quotation outputs a true value. If the quotation ever yields a result which is not " { $link f } ", then the value is output, along with the element of the sequence which yielded this." } ;
 
 HELP: any?
@@ -1132,12 +1132,12 @@ HELP: product
 { $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" number } }
+{ $values { "seq" "a sequence of real numbers" } { "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" } { "n" number } }
+{ $values { "seq" "a sequence of real numbers" } { "elt" object } }
 { $description "Outputs the greatest element of " { $snippet "seq" } "." }
 { $errors "Throws an error if the sequence is empty." } ;
 
index bb132b8e5b1cca09d7e5390a3248a3bb0ac611da..f68067155996dc8ef1424d4883f3665e36ba218d 100644 (file)
@@ -1038,9 +1038,9 @@ M: repetition sum [ elt>> ] [ len>> ] bi * ; inline
 
 : product ( seq -- n ) 1 [ * ] binary-reduce ;
 
-: infimum ( seq -- n ) [ ] [ min ] map-reduce ;
+: infimum ( seq -- elt ) [ ] [ min ] map-reduce ;
 
-: supremum ( seq -- n ) [ ] [ max ] map-reduce ;
+: supremum ( seq -- elt ) [ ] [ max ] map-reduce ;
 
 : map-sum ( ... seq quot: ( ... elt -- ... n ) -- ... n )
     [ 0 ] 2dip [ dip + ] curry [ swap ] prepose each ; inline
index 035d131dd2df4e8e35e9ea2b7084f21c23b8e83c..615a52c6374e12f3039e849e3e695e2c9cf03285 100644 (file)
@@ -43,7 +43,7 @@ HELP: 1vector
 { $description "Create a new vector with one element." } ;
 
 HELP: ?push
-{ $values { "elt" object } { "seq/f" "a resizable mutable sequence, or " { $link f } } { "seq" "a resizable mutable sequence" } }
+{ $values { "elt" object } { "seq/f" { $maybe "a resizable mutable sequence" } } { "seq" "a resizable mutable sequence" } }
 { $description "If the given sequence is " { $link f } ", creates and outputs a new one-element vector holding " { $snippet "elt" } ". Otherwise, pushes " { $snippet "elt" } " onto the given sequence." }
 { $errors "Throws an error if " { $snippet "seq" } " is not resizable, or if the type of " { $snippet "elt" } " is not permitted in " { $snippet "seq" } "." }
 { $side-effects "seq" } ;
index f50bdd6d0de48037fe646a76194fc545da6177b2..e4be81052fdb4b675380f2097734003e2c9f9fe5 100755 (executable)
@@ -1,5 +1,5 @@
 USING: vocabs vocabs.loader.private help.markup help.syntax
-words strings io ;
+words strings io hashtables ;
 IN: vocabs.loader
 
 ARTICLE: "add-vocab-roots" "Working with code outside of the Factor source tree"
@@ -72,7 +72,7 @@ $nl
 ABOUT: "vocabs.loader"
 
 HELP: load-vocab
-{ $values { "name" "a string" } { "vocab" "a hashtable or " { $link f } } }
+{ $values { "name" "a string" } { "vocab" { $maybe hashtable } } }
 { $description "Attempts to load a vocabulary from disk, or looks up the vocabulary in the dictionary, and then outputs that vocabulary object." } ;
 
 HELP: vocab-main
@@ -123,9 +123,9 @@ HELP: run
 { $description "Runs a vocabulary's main entry point. The main entry point is set with the " { $link POSTPONE: MAIN: } " parsing word." } ;
 
 HELP: vocab-source-path
-{ $values { "vocab" "a vocabulary specifier" } { "path/f" "a pathname string or " { $link f } } }
+{ $values { "vocab" "a vocabulary specifier" } { "path/f" { $maybe "a pathname string" } } }
 { $description "Outputs a pathname where source code for " { $snippet "vocab" } " might be found. Outputs " { $link f } " if the vocabulary does not have a directory on disk." } ;
 
 HELP: vocab-docs-path
-{ $values { "vocab" "a vocabulary specifier" } { "path/f" "a pathname string or " { $link f } } }
+{ $values { "vocab" "a vocabulary specifier" } { "path/f" { $maybe "a pathname string" } } }
 { $description "Outputs a pathname where the documentation for " { $snippet "vocab" } " might be found. Outputs " { $link f } " if the vocabulary does not have a directory on disk." } ;
index 1f23d5cbbf8f7038fb72ae998e3ebe0fa2e03b10..b4651651d4cd365d170667b70d2dcda4df755bd2 100644 (file)
@@ -346,7 +346,7 @@ HELP: deprecated?
 { $notes "Outputs " { $link f } " if the object is not a word." } ;
 
 HELP: inline?
-{ $values { "obj" object } { "?" "a boolean" } }
+{ $values { "obj" object } { "?" boolean } }
 { $description "Tests if an object is " { $link POSTPONE: inline } "." }
 { $notes "Outputs " { $link f } " if the object is not a word." } ;
 
index 2e5a5c182b1cd04a8e8b1bad1f44307bd9440726..519fe9937845876c165dedb83845176dec06d57d 100644 (file)
@@ -389,21 +389,21 @@ HELP: struct-wrapper
 HELP: unmarshall-bool
 { $values
     { "n" number }
-    { "?" "a boolean" }
+    { "?" boolean }
 }
 { $description "Unmarshalls a number to a boolean." } ;
 
 HELP: unmarshall-bool*
 { $values
     { "alien" alien }
-    { "?" "a boolean" }
+    { "?" boolean }
 }
 { $description "Unmarshalls a C pointer to a boolean." } ;
 
 HELP: unmarshall-bool*-free
 { $values
     { "alien" alien }
-    { "?" "a boolean" }
+    { "?" boolean }
 }
 { $description "Unmarshalls a C pointer to a boolean and frees the pointer." } ;