From 98935b7f1575bbcd91f06aa444f642009189b218 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sun, 18 May 2014 20:09:10 -0700 Subject: [PATCH] docs: change ``{ $quotation "( x -- y )" }`` to ``{ $quotation ( x -- y ) }``. --- basis/binary-search/binary-search-docs.factor | 2 +- basis/cocoa/messages/messages-docs.factor | 2 +- basis/combinators/smart/smart-docs.factor | 2 +- .../combinators/combinators-docs.factor | 10 +- basis/concurrency/futures/futures-docs.factor | 2 +- .../mailboxes/mailboxes-docs.factor | 10 +- basis/documents/documents-docs.factor | 2 +- basis/environment/environment-docs.factor | 2 +- basis/furnace/auth/auth-docs.factor | 2 +- .../conversations/conversations-docs.factor | 2 +- basis/furnace/sessions/sessions-docs.factor | 2 +- basis/furnace/utilities/utilities-docs.factor | 4 +- basis/furnace/utilities/utilities.factor | 2 +- basis/graphs/graphs-docs.factor | 2 +- basis/grouping/grouping-docs.factor | 2 +- basis/help/help-docs.factor | 4 +- basis/help/markup/markup.factor | 1 + basis/html/templates/chloe/chloe-docs.factor | 4 +- basis/http/client/client-docs.factor | 4 +- basis/http/server/static/static-docs.factor | 2 +- basis/io/mmap/mmap-docs.factor | 4 +- basis/io/monitors/monitors-docs.factor | 2 +- basis/io/pools/pools-docs.factor | 2 +- basis/io/timeouts/timeouts-docs.factor | 2 +- basis/lists/lazy/lazy-docs.factor | 22 ++--- basis/lists/lists-docs.factor | 8 +- .../combinatorics/combinatorics-docs.factor | 4 +- basis/math/statistics/statistics-docs.factor | 8 +- basis/math/vectors/vectors-docs.factor | 2 +- basis/models/arrow/arrow-docs.factor | 2 +- basis/models/arrow/smart/smart-docs.factor | 4 +- basis/models/models-docs.factor | 6 +- basis/peg/peg-docs.factor | 4 +- basis/prettyprint/backend/backend-docs.factor | 2 +- .../prettyprint/sections/sections-docs.factor | 4 +- basis/promises/promises-docs.factor | 6 +- basis/regexp/regexp-docs.factor | 2 +- basis/sequences/deep/deep-docs.factor | 14 +-- .../generalizations-docs.factor | 22 ++--- basis/sequences/product/product-docs.factor | 8 +- basis/sequences/unrolled/unrolled-docs.factor | 22 ++--- basis/threads/threads-docs.factor | 4 +- .../tools/annotations/annotations-docs.factor | 2 +- basis/tools/test/test-docs.factor | 2 +- basis/tools/walker/walker-docs.factor | 2 +- basis/ui/gadgets/buttons/buttons-docs.factor | 8 +- basis/ui/gadgets/editors/editors-docs.factor | 4 +- basis/ui/gadgets/gadgets-docs.factor | 6 +- basis/ui/gadgets/menus/menus-docs.factor | 2 +- basis/ui/gadgets/panes/panes-docs.factor | 2 +- .../presentations/presentations-docs.factor | 2 +- basis/ui/operations/operations-docs.factor | 10 +- basis/ui/tools/debugger/debugger-docs.factor | 2 +- basis/ui/ui-docs.factor | 4 +- basis/unix/signals/signals-docs.factor | 4 +- core/assocs/assocs-docs.factor | 28 +++--- core/classes/predicate/predicate-docs.factor | 2 +- core/combinators/combinators-docs.factor | 6 +- core/continuations/continuations-docs.factor | 10 +- core/destructors/destructors-docs.factor | 2 +- core/generic/generic-docs.factor | 2 +- core/generic/math/math-docs.factor | 2 +- core/io/io-docs.factor | 4 +- core/kernel/kernel-docs.factor | 78 +++++++-------- core/lexer/lexer-docs.factor | 6 +- core/math/math-docs.factor | 8 +- core/math/order/order-docs.factor | 2 +- core/memory/memory-docs.factor | 2 +- core/namespaces/namespaces-docs.factor | 4 +- core/parser/parser-docs.factor | 2 +- core/sequences/sequences-docs.factor | 96 +++++++++---------- core/sorting/sorting-docs.factor | 6 +- core/splitting/splitting-docs.factor | 8 +- core/vocabs/vocabs-docs.factor | 2 +- extra/backtrack/backtrack-docs.factor | 6 +- extra/coroutines/coroutines-docs.factor | 2 +- extra/gpu/buffers/buffers-docs.factor | 4 +- extra/grouping/extras/extras-docs.factor | 2 +- .../html/parser/analyzer/analyzer-docs.factor | 4 +- .../partial-continuations-docs.factor | 4 +- extra/path-finding/path-finding-docs.factor | 6 +- extra/readline/readline-docs.factor | 4 +- extra/splitting/extras/extras-docs.factor | 4 +- extra/ui/gadgets/lists/lists-docs.factor | 2 +- 84 files changed, 288 insertions(+), 287 deletions(-) diff --git a/basis/binary-search/binary-search-docs.factor b/basis/binary-search/binary-search-docs.factor index da71d34dce..b6a1f48a95 100644 --- a/basis/binary-search/binary-search-docs.factor +++ b/basis/binary-search/binary-search-docs.factor @@ -2,7 +2,7 @@ IN: binary-search USING: help.markup help.syntax sequences kernel math.order ; HELP: search -{ $values { "seq" "a sorted sequence" } { "quot" { $quotation "( elt -- <=> )" } } { "i" "an index, or " { $link f } } { "elt" "an element, or " { $link f } } } +{ $values { "seq" "a sorted sequence" } { "quot" { $quotation ( elt -- <=> ) } } { "i" "an index, or " { $link f } } { "elt" "an element, or " { $link f } } } { $description "Performs a binary search on a sequence, calling the quotation to decide whether to end the search (" { $link +eq+ } "), search lower (" { $link +lt+ } ") or search higher (" { $link +gt+ } ")." $nl "If the sequence is non-empty, outputs the index and value of the closest match, which is either an element for which the quotation output " { $link +eq+ } ", or failing that, least element for which the quotation output " { $link +lt+ } "." diff --git a/basis/cocoa/messages/messages-docs.factor b/basis/cocoa/messages/messages-docs.factor index 7dee15d2e2..a0eed26c5b 100644 --- a/basis/cocoa/messages/messages-docs.factor +++ b/basis/cocoa/messages/messages-docs.factor @@ -31,7 +31,7 @@ HELP: alien>objc-types { objc>alien-types alien>objc-types } related-words HELP: import-objc-class -{ $values { "name" string } { "quot" { $quotation "( -- )" } } } +{ $values { "name" string } { "quot" { $quotation ( -- ) } } } { $description "If a class named " { $snippet "name" } " is already known to the Objective C interface, does nothing. Otherwise, first calls the quotation. The quotation should make the class available to the Objective C runtime if necessary, either by loading a framework or defining it directly. After the quotation returns, this word makes the class available to Factor programs by importing methods and creating a class word the class object in the " { $vocab-link "cocoa.classes" } " vocabulary." } ; HELP: root-class diff --git a/basis/combinators/smart/smart-docs.factor b/basis/combinators/smart/smart-docs.factor index cab79ad675..a92067d34d 100644 --- a/basis/combinators/smart/smart-docs.factor +++ b/basis/combinators/smart/smart-docs.factor @@ -228,7 +228,7 @@ HELP: smart-when* HELP: smart-with { $values - { "param" object } { "obj" object } { "quot" { $quotation "( param ..a -- ..b" } } { "curry" curry } } + { "param" object } { "obj" object } { "quot" { $quotation "( param ..a -- ..b )" } } { "curry" curry } } { $description "A version of " { $link with } " that puts the parameter before any inputs the quotation uses." } ; HELP: smart-reduce diff --git a/basis/concurrency/combinators/combinators-docs.factor b/basis/concurrency/combinators/combinators-docs.factor index d909ddbeba..28d6d11bd5 100644 --- a/basis/concurrency/combinators/combinators-docs.factor +++ b/basis/concurrency/combinators/combinators-docs.factor @@ -2,27 +2,27 @@ USING: help.markup help.syntax sequences ; IN: concurrency.combinators HELP: parallel-map -{ $values { "seq" sequence } { "quot" { $quotation "( elt -- newelt )" } } { "newseq" sequence } } +{ $values { "seq" sequence } { "quot" { $quotation ( elt -- newelt ) } } { "newseq" sequence } } { $description "Spawns a new thread for applying " { $snippet "quot" } " to every element of " { $snippet "seq" } ", collecting the results at the end." } { $errors "Throws an error if one of the iterations throws an error." } ; HELP: 2parallel-map -{ $values { "seq1" sequence } { "seq2" sequence } { "quot" { $quotation "( elt1 elt2 -- newelt )" } } { "newseq" sequence } } +{ $values { "seq1" sequence } { "seq2" sequence } { "quot" { $quotation ( elt1 elt2 -- newelt ) } } { "newseq" sequence } } { $description "Spawns a new thread for applying " { $snippet "quot" } " to pairwise elements of " { $snippet "seq1" } " and " { $snippet "seq2" } ", collecting the results at the end." } { $errors "Throws an error if one of the iterations throws an error." } ; HELP: parallel-each -{ $values { "seq" sequence } { "quot" { $quotation "( elt -- )" } } } +{ $values { "seq" sequence } { "quot" { $quotation ( elt -- ) } } } { $description "Spawns a new thread for applying " { $snippet "quot" } " to every element of " { $snippet "seq" } ", blocking until all quotations complete." } { $errors "Throws an error if one of the iterations throws an error." } ; HELP: 2parallel-each -{ $values { "seq1" sequence } { "seq2" sequence } { "quot" { $quotation "( elt1 elt2 -- )" } } } +{ $values { "seq1" sequence } { "seq2" sequence } { "quot" { $quotation ( elt1 elt2 -- ) } } } { $description "Spawns a new thread for applying " { $snippet "quot" } " to pairwise elements of " { $snippet "seq1" } " and " { $snippet "seq2" } ", blocking until all quotations complete." } { $errors "Throws an error if one of the iterations throws an error." } ; HELP: parallel-filter -{ $values { "seq" sequence } { "quot" { $quotation "( elt -- ? )" } } { "newseq" sequence } } +{ $values { "seq" sequence } { "quot" { $quotation ( elt -- ? ) } } { "newseq" sequence } } { $description "Spawns a new thread for applying " { $snippet "quot" } " to every element of " { $snippet "seq" } ", collecting the elements for which the quotation yielded a true value." } { $errors "Throws an error if one of the iterations throws an error." } ; diff --git a/basis/concurrency/futures/futures-docs.factor b/basis/concurrency/futures/futures-docs.factor index ff5773a86c..56f8c73237 100644 --- a/basis/concurrency/futures/futures-docs.factor +++ b/basis/concurrency/futures/futures-docs.factor @@ -5,7 +5,7 @@ continuations help.markup help.syntax quotations calendar ; IN: concurrency.futures HELP: future -{ $values { "quot" { $quotation "( -- value )" } } { "future" future } } +{ $values { "quot" { $quotation ( -- value ) } } { "future" future } } { $description "Creates a deferred computation." $nl "The quotation begins with an empty data stack, an empty catch stack, and a name stack containing the global namespace only. This means that the only way to pass data to the quotation is to partially apply the data, for example using " { $link curry } " or " { $link compose } "." } ; diff --git a/basis/concurrency/mailboxes/mailboxes-docs.factor b/basis/concurrency/mailboxes/mailboxes-docs.factor index 461650738e..41386fd82e 100644 --- a/basis/concurrency/mailboxes/mailboxes-docs.factor +++ b/basis/concurrency/mailboxes/mailboxes-docs.factor @@ -21,7 +21,7 @@ HELP: block-unless-pred { $values { "mailbox" mailbox } { "timeout" "a " { $link duration } " or " { $link f } } - { "pred" { $quotation "( ... message -- ... ? )" } } + { "pred" { $quotation ( ... message -- ... ? ) } } } { $description "Block the thread if there are no items in the mailbox that return true when the predicate is called with the item on the stack." } ; @@ -40,14 +40,14 @@ HELP: mailbox-get-all { $description "Blocks the thread if the mailbox is empty, otherwise removes all objects in the mailbox and returns an array containing the objects." } ; HELP: while-mailbox-empty -{ $values { "mailbox" mailbox } - { "quot" { $quotation "( -- )" } } +{ $values { "mailbox" mailbox } + { "quot" { $quotation ( -- ) } } } { $description "Repeatedly call the quotation while there are no items in the mailbox." } ; HELP: mailbox-get? -{ $values { "mailbox" mailbox } - { "pred" { $quotation "( obj -- ? )" } } +{ $values { "mailbox" mailbox } + { "pred" { $quotation ( obj -- ? ) } } { "obj" object } } { $description "Get the first item in the mailbox which satisfies the predicate. When the predicate returns true that item will be returned. If nothing in the mailbox satisfies the predicate then the thread will block until something does." } ; diff --git a/basis/documents/documents-docs.factor b/basis/documents/documents-docs.factor index 203a6e3b09..82ed0eb0a5 100644 --- a/basis/documents/documents-docs.factor +++ b/basis/documents/documents-docs.factor @@ -42,7 +42,7 @@ HELP: doc-lines { $errors "Throws an error if " { $snippet "from" } " or " { $snippet "to" } " is out of bounds." } ; HELP: each-line -{ $values { "from" "a non-negative integer" } { "to" "a non-negative integer" } { "quot" { $quotation "( ... line -- ... )" } } } +{ $values { "from" "a non-negative integer" } { "to" "a non-negative integer" } { "quot" { $quotation ( ... line -- ... ) } } } { $description "Applies the quotation to each line in the range." } { $notes "The range is created by calling " { $link } "." } { $errors "Throws an error if " { $snippet "from" } " or " { $snippet "to" } " is out of bounds." } ; diff --git a/basis/environment/environment-docs.factor b/basis/environment/environment-docs.factor index 6129b07302..823c9b35a4 100644 --- a/basis/environment/environment-docs.factor +++ b/basis/environment/environment-docs.factor @@ -31,7 +31,7 @@ HELP: os-env } ; HELP: change-os-env -{ $values { "key" string } { "quot" { $quotation "( old -- new )" } } } +{ $values { "key" string } { "quot" { $quotation ( old -- new ) } } } { $description "Applies a quotation to change the value stored in an environment variable." } { $examples "This is an operating system-specific feature. On Unix, you can do:" diff --git a/basis/furnace/auth/auth-docs.factor b/basis/furnace/auth/auth-docs.factor index 6e468efba5..e2c96b981f 100644 --- a/basis/furnace/auth/auth-docs.factor +++ b/basis/furnace/auth/auth-docs.factor @@ -63,7 +63,7 @@ HELP: realm { $class-description "The class of authentication realms. See " { $link "furnace.auth.realms" } " for details." } ; HELP: uchange -{ $values { "quot" { $quotation "( old -- new )" } } { "key" symbol } } +{ $values { "quot" { $quotation ( old -- new ) } } { "key" symbol } } { $description "Applies the quotation to the old value of the user profile variable, and assigns the resulting value back to the variable." } ; HELP: uget diff --git a/basis/furnace/conversations/conversations-docs.factor b/basis/furnace/conversations/conversations-docs.factor index 443384147d..2f935c33e6 100644 --- a/basis/furnace/conversations/conversations-docs.factor +++ b/basis/furnace/conversations/conversations-docs.factor @@ -28,7 +28,7 @@ HELP: cset { $description "Sets the value of a conversation variable." } ; HELP: cchange -{ $values { "key" symbol } { "quot" { $quotation "( old -- new )" } } } +{ $values { "key" symbol } { "quot" { $quotation ( old -- new ) } } } { $description "Applies the quotation to the old value of the conversation variable, and assigns the resulting value back to the variable." } ; ARTICLE: "furnace.conversations" "Furnace conversation scope" diff --git a/basis/furnace/sessions/sessions-docs.factor b/basis/furnace/sessions/sessions-docs.factor index 605b04785c..e272f36fa1 100644 --- a/basis/furnace/sessions/sessions-docs.factor +++ b/basis/furnace/sessions/sessions-docs.factor @@ -11,7 +11,7 @@ HELP: { $description "Wraps a responder in a session manager responder." } ; HELP: schange -{ $values { "key" symbol } { "quot" { $quotation "( old -- new )" } } } +{ $values { "key" symbol } { "quot" { $quotation ( old -- new ) } } } { $description "Applies the quotation to the old value of the session variable, and assigns the resulting value back to the variable." } ; HELP: sget diff --git a/basis/furnace/utilities/utilities-docs.factor b/basis/furnace/utilities/utilities-docs.factor index fc1828bbb6..1d6f90a8e2 100644 --- a/basis/furnace/utilities/utilities-docs.factor +++ b/basis/furnace/utilities/utilities-docs.factor @@ -16,7 +16,7 @@ HELP: client-state { $notes "This word is used by session management, conversation scope and asides." } ; HELP: each-responder -{ $values { "quot" { $quotation "( responder -- )" } } } +{ $values { "quot" { $quotation ( ... responder -- ... ) } } } { $description "Applies the quotation to each responder involved in processing the current request." } ; HELP: hidden-form-field @@ -88,7 +88,7 @@ HELP: exit-with { $description "Exits from an outer " { $link with-exit-continuation } "." } ; HELP: with-exit-continuation -{ $values { "quot" { $quotation { "( -- value )" } } } { "value" "a value returned by the quotation or an " { $link exit-with } " invocation" } } +{ $values { "quot" { $quotation ( -- value ) } } { "value" "a value returned by the quotation or an " { $link exit-with } " invocation" } } { $description "Runs a quotation with the " { $link exit-continuation } " variable bound. Calling " { $link exit-with } " in the quotation will immediately return." } { $notes "Furnace actions and authentication realms wrap their execution in this combinator, allowing form validation failures and login requests, respectively, to immediately return an HTTP response to the client without running any more responder code." } ; diff --git a/basis/furnace/utilities/utilities.factor b/basis/furnace/utilities/utilities.factor index 9a82490482..61547131fc 100644 --- a/basis/furnace/utilities/utilities.factor +++ b/basis/furnace/utilities/utilities.factor @@ -24,7 +24,7 @@ ERROR: no-such-word name vocab ; : nested-responders ( -- seq ) responder-nesting get values ; -: each-responder ( quot -- ) +: each-responder ( quot: ( ... responder -- ... ) -- ) nested-responders swap each ; inline ERROR: no-such-responder responder ; diff --git a/basis/graphs/graphs-docs.factor b/basis/graphs/graphs-docs.factor index 66e896065c..45f7f81ae7 100644 --- a/basis/graphs/graphs-docs.factor +++ b/basis/graphs/graphs-docs.factor @@ -28,5 +28,5 @@ HELP: remove-vertex { $side-effects "graph" } ; HELP: closure -{ $values { "vertex" object } { "quot" { $quotation "( vertex -- assoc )" } } { "assoc" "a new assoc" } } +{ $values { "vertex" object } { "quot" { $quotation ( vertex -- assoc ) } } { "assoc" "a new assoc" } } { $description "Outputs a set of all vertices reachable from " { $snippet "vertex" } " via edges given by the quotation. The set always includes " { $snippet "vertex" } "." } ; diff --git a/basis/grouping/grouping-docs.factor b/basis/grouping/grouping-docs.factor index 80ec52faf5..f22dbf9e0a 100644 --- a/basis/grouping/grouping-docs.factor +++ b/basis/grouping/grouping-docs.factor @@ -153,7 +153,7 @@ HELP: { } related-words HELP: monotonic? -{ $values { "seq" sequence } { "quot" { $quotation "( elt1 elt2 -- ? )" } } { "?" "a boolean" } } +{ $values { "seq" sequence } { "quot" { $quotation ( elt1 elt2 -- ? ) } } { "?" "a boolean" } } { $description "Applies the relation to successive pairs of elements in the sequence, testing for a truth value. The relation should be a transitive relation, such as a total order or an equality relation." } { $examples "Testing if a sequence is non-decreasing:" diff --git a/basis/help/help-docs.factor b/basis/help/help-docs.factor index bc1cbd7f64..6cff585eee 100644 --- a/basis/help/help-docs.factor +++ b/basis/help/help-docs.factor @@ -340,7 +340,7 @@ HELP: $link } ; HELP: textual-list -{ $values { "seq" "a sequence" } { "quot" { $quotation "( elt -- )" } } } +{ $values { "seq" "a sequence" } { "quot" { $quotation ( elt -- ) } } } { $description "Applies the quotation to each element of the sequence, printing a comma between each pair of elements." } { $examples { $example "USING: help.markup io namespaces ;" "last-element off" "{ \"fish\" \"chips\" \"salt\" } [ write ] textual-list" "fish, chips, salt" } @@ -406,7 +406,7 @@ HELP: $quotation "Produces the text “a quotation with stack effect " { $emphasis "effect" } "”." } { $examples - { $markup-example { $quotation "( obj -- )" } } + { $markup-example { $quotation ( obj -- ) } } } ; HELP: $list diff --git a/basis/help/markup/markup.factor b/basis/help/markup/markup.factor index f4a000ac64..6c06f120b9 100644 --- a/basis/help/markup/markup.factor +++ b/basis/help/markup/markup.factor @@ -43,6 +43,7 @@ M: simple-element print-element [ print-element ] each ; M: string print-element [ write ] ($span) ; M: array print-element unclip execute( arg -- ) ; M: word print-element { } swap execute( arg -- ) ; +M: effect print-element present print-element ; M: f print-element drop ; : print-element* ( element style -- ) diff --git a/basis/html/templates/chloe/chloe-docs.factor b/basis/html/templates/chloe/chloe-docs.factor index 7b5f6bc619..8ec925fc7d 100644 --- a/basis/html/templates/chloe/chloe-docs.factor +++ b/basis/html/templates/chloe/chloe-docs.factor @@ -25,7 +25,7 @@ HELP: compile-attr HELP: CHLOE: { $syntax "CHLOE: name definition... ;" } -{ $values { "name" "the tag name" } { "definition" { $quotation "( tag -- )" } } } +{ $values { "name" "the tag name" } { "definition" { $quotation ( tag -- ) } } } { $description "Defines compilation semantics for the Chloe tag named " { $snippet "tag" } ". The definition body receives a " { $link tag } " on the stack." } ; HELP: COMPONENT: @@ -47,7 +47,7 @@ HELP: [code] { $description "Compiles the quotation. It will be called when the template is called." } ; HELP: process-children -{ $values { "tag" tag } { "quot" { $quotation "( compiled-tag -- )" } } } +{ $values { "tag" tag } { "quot" { $quotation ( compiled-tag -- ) } } } { $description "Compiles the tag. The quotation will be applied to the resulting quotation when the template is called." } { $examples "See " { $link "html.templates.chloe.extend.tags.example" } " for an example which uses this word to implement a custom control flow tag." } ; diff --git a/basis/http/client/client-docs.factor b/basis/http/client/client-docs.factor index 3c908ee619..77aa293dac 100644 --- a/basis/http/client/client-docs.factor +++ b/basis/http/client/client-docs.factor @@ -137,11 +137,11 @@ HELP: http-request* { $description "Sends an HTTP request to an HTTP server, and reads the response." } ; HELP: with-http-request -{ $values { "request" request } { "quot" { $quotation "( chunk -- )" } } { "response" response } } +{ $values { "request" request } { "quot" { $quotation ( chunk -- ) } } { "response" response } } { $description "A variant of " { $link with-http-request* } " that checks that the response was successful." } ; HELP: with-http-request* -{ $values { "request" request } { "quot" { $quotation "( chunk -- )" } } { "response" response } } +{ $values { "request" request } { "quot" { $quotation ( chunk -- ) } } { "response" response } } { $description "Sends an HTTP request to an HTTP server, and reads the response incrementally. Chunks of data are passed to the quotation as they are read. Does not throw an error if the HTTP request fails; to do so, call " { $link check-response } " on the " { $snippet "response" } "." } ; { http-request http-request* with-http-request with-http-request* } related-words diff --git a/basis/http/server/static/static-docs.factor b/basis/http/server/static/static-docs.factor index 22d6efe680..523862db5c 100644 --- a/basis/http/server/static/static-docs.factor +++ b/basis/http/server/static/static-docs.factor @@ -4,7 +4,7 @@ USING: help.markup help.syntax io.streams.string ; IN: http.server.static HELP: -{ $values { "root" "a pathname string" } { "hook" { $quotation "( path mime-type -- response )" } } { "responder" file-responder } } +{ $values { "root" "a pathname string" } { "hook" { $quotation ( path mime-type -- response ) } } { "responder" file-responder } } { $description "Creates a file responder which serves content from " { $snippet "path" } " by using the hook to generate a response." } ; HELP: diff --git a/basis/io/mmap/mmap-docs.factor b/basis/io/mmap/mmap-docs.factor index 49d44616bf..b5bfff28ab 100644 --- a/basis/io/mmap/mmap-docs.factor +++ b/basis/io/mmap/mmap-docs.factor @@ -18,13 +18,13 @@ HELP: { $errors "Throws an error if a memory mapping could not be established." } ; HELP: with-mapped-file -{ $values { "path" "a pathname string" } { "quot" { $quotation "( mmap -- )" } } } +{ $values { "path" "a pathname string" } { "quot" { $quotation ( mmap -- ) } } } { $contract "Opens a file for read/write access and maps its contents into memory, passing the " { $link mapped-file } " instance to the quotation. The mapped file is disposed of when the quotation returns, or if an error is thrown." } { $notes "This is a low-level word, because " { $link mapped-file } " objects simply expose their base address and length. Most applications should use " { $link "io.mmap.arrays" } " instead." } { $errors "Throws an error if a memory mapping could not be established." } ; HELP: with-mapped-file-reader -{ $values { "path" "a pathname string" } { "quot" { $quotation "( mmap -- )" } } } +{ $values { "path" "a pathname string" } { "quot" { $quotation ( mmap -- ) } } } { $contract "Opens a file for read-only access and maps its contents into memory, passing the " { $link mapped-file } " instance to the quotation. The mapped file is disposed of when the quotation returns, or if an error is thrown." } { $notes "This is a low-level word, because " { $link mapped-file } " objects simply expose their base address and length. See " { $link "io.mmap.arrays" } " for a discussion of how to access data in a mapped file." } { $errors "Throws an error if a memory mapping could not be established." } ; diff --git a/basis/io/monitors/monitors-docs.factor b/basis/io/monitors/monitors-docs.factor index 2fa13862a4..4fd616cca1 100644 --- a/basis/io/monitors/monitors-docs.factor +++ b/basis/io/monitors/monitors-docs.factor @@ -26,7 +26,7 @@ HELP: next-change { $errors "Throws an error if the monitor is closed from another thread." } ; HELP: with-monitor -{ $values { "path" "a pathname string" } { "recursive?" "a boolean" } { "quot" { $quotation "( monitor -- )" } } } +{ $values { "path" "a pathname string" } { "recursive?" "a boolean" } { "quot" { $quotation ( monitor -- ) } } } { $description "Opens a file system change monitor and passes it to the quotation. Closes the monitor after the quotation returns or throws an error." } { $errors "Throws an error if the pathname does not exist, if a monitor could not be created or if the platform does not support monitors." } ; diff --git a/basis/io/pools/pools-docs.factor b/basis/io/pools/pools-docs.factor index 80c8b2d925..16f651f423 100644 --- a/basis/io/pools/pools-docs.factor +++ b/basis/io/pools/pools-docs.factor @@ -22,7 +22,7 @@ HELP: return-connection { $description "Returns a connection to the pool." } ; HELP: with-pooled-connection -{ $values { "pool" pool } { "quot" { $quotation "( conn -- )" } } } +{ $values { "pool" pool } { "quot" { $quotation ( conn -- ) } } } { $description "Calls a quotation with a pooled connection on the stack. If the quotation returns successfully, the connection is returned to the pool; if the quotation throws an error, the connection is disposed of with " { $link dispose } "." } ; HELP: make-connection diff --git a/basis/io/timeouts/timeouts-docs.factor b/basis/io/timeouts/timeouts-docs.factor index ce71b1c99b..626f0c24c0 100644 --- a/basis/io/timeouts/timeouts-docs.factor +++ b/basis/io/timeouts/timeouts-docs.factor @@ -22,7 +22,7 @@ HELP: cancel-operation { $contract "Handles a timeout, usually by waking up all threads waiting on the object." } ; HELP: with-timeout -{ $values { "obj" object } { "quot" { $quotation "( obj -- )" } } } +{ $values { "obj" object } { "quot" { $quotation ( obj -- ) } } } { $description "Applies the quotation to the object. If the object's timeout expires before the quotation returns, " { $link cancel-operation } " is called on the object." } ; ARTICLE: "io.timeouts" "I/O timeout protocol" diff --git a/basis/lists/lazy/lazy-docs.factor b/basis/lists/lazy/lazy-docs.factor index f18dba0592..05865f495c 100644 --- a/basis/lists/lazy/lazy-docs.factor +++ b/basis/lists/lazy/lazy-docs.factor @@ -58,22 +58,22 @@ ARTICLE: { "lists.lazy" "manipulation" } "Manipulating lazy lists" } ; HELP: lazy-cons -{ $values { "car" { $quotation "( -- elt )" } } { "cdr" { $quotation "( -- cons )" } } { "promise" "the resulting cons object" } } +{ $values { "car" { $quotation ( -- elt ) } } { "cdr" { $quotation ( -- cons ) } } { "promise" "the resulting cons object" } } { $description "Constructs a cons object for a lazy list from two quotations. The " { $snippet "car" } " quotation should return the head of the list, and the " { $snippet "cons" } " quotation the tail when called. When " { $link cons } " or " { $link cdr } " are called on the lazy-cons object then the appropriate quotation is called." } { $see-also cons car cdr nil nil? } ; { 1lazy-list 2lazy-list 3lazy-list } related-words HELP: 1lazy-list -{ $values { "a" { $quotation "( -- X )" } } { "lazy-cons" "a lazy-cons object" } } +{ $values { "a" { $quotation ( -- X ) } } { "lazy-cons" "a lazy-cons object" } } { $description "Create a lazy list with 1 element. The element is the result of calling the quotation. The quotation is only called when the list element is requested." } ; HELP: 2lazy-list -{ $values { "a" { $quotation "( -- X )" } } { "b" { $quotation "( -- X )" } } { "lazy-cons" "a lazy-cons object" } } +{ $values { "a" { $quotation ( -- X ) } } { "b" { $quotation ( -- X ) } } { "lazy-cons" "a lazy-cons object" } } { $description "Create a lazy list with 2 elements. The elements are the result of calling the quotations. The quotations are only called when the list elements are requested." } ; HELP: 3lazy-list -{ $values { "a" { $quotation "( -- X )" } } { "b" { $quotation "( -- X )" } } { "c" { $quotation "( -- X )" } } { "lazy-cons" "a lazy-cons object" } } +{ $values { "a" { $quotation ( -- X ) } } { "b" { $quotation ( -- X ) } } { "c" { $quotation ( -- X ) } } { "lazy-cons" "a lazy-cons object" } } { $description "Create a lazy list with 3 elements. The elements are the result of calling the quotations. The quotations are only called when the list elements are requested." } ; HELP: @@ -84,7 +84,7 @@ HELP: { lazy-map ltake lfilter lappend lfrom lfrom-by lconcat lcartesian-product lcartesian-product* lcomp lcomp* lmerge lwhile luntil } related-words HELP: lazy-map -{ $values { "list" "a cons object" } { "quot" { $quotation "( obj -- X )" } } { "result" "resulting cons object" } } +{ $values { "list" "a cons object" } { "quot" { $quotation ( obj -- X ) } } { "result" "resulting cons object" } } { $description "Perform a similar functionality to that of the " { $link map } " word, but in a lazy manner. No evaluation of the list elements occurs initially but a " { $link } " object is returned which conforms to the list protocol. Calling " { $link car } ", " { $link cdr } " or " { $link nil? } " on this will evaluate elements as required." } ; HELP: ltake @@ -92,15 +92,15 @@ HELP: ltake { $description "Outputs a lazy list containing the first n items in the list. This is done a lazy manner. No evaluation of the list elements occurs initially but a " { $link } " object is returned which conforms to the list protocol. Calling " { $link car } ", " { $link cdr } " or " { $link nil? } " on this will evaluate elements as required." } ; HELP: lfilter -{ $values { "list" "a cons object" } { "quot" { $quotation "( -- X )" } } { "result" "resulting cons object" } } +{ $values { "list" "a cons object" } { "quot" { $quotation ( -- X ) } } { "result" "resulting cons object" } } { $description "Perform a similar functionality to that of the " { $link filter } " word, but in a lazy manner. No evaluation of the list elements occurs initially but a " { $link } " object is returned which conforms to the list protocol. Calling " { $link car } ", " { $link cdr } " or " { $link nil? } " on this will evaluate elements as required." } ; HELP: lwhile -{ $values { "list" "a cons object" } { "quot" { $quotation "( X -- ? )" } } { "result" "resulting cons object" } } +{ $values { "list" "a cons object" } { "quot" { $quotation ( x -- ? ) } } { "result" "resulting cons object" } } { $description "Outputs a lazy list containing the first items in the list as long as " { $snippet "quot" } " evaluates to t. No evaluation of the list elements occurs initially but a " { $link } " object is returned with conforms to the list protocol. Calling " { $link car } ", " { $link cdr } " or " { $link nil? } " on this will evaluate elements as required." } ; HELP: luntil -{ $values { "list" "a cons object" } { "quot" { $quotation "( X -- ? )" } } { "result" "resulting cons object" } } +{ $values { "list" "a cons object" } { "quot" { $quotation ( x -- ? ) } } { "result" "resulting cons object" } } { $description "Outputs a lazy list containing the first items in the list until after " { $snippet "quot" } " evaluates to t. No evaluation of the list elements occurs initially but a " { $link } " object is returned with conforms to the list protocol. Calling " { $link car } ", " { $link cdr } " or " { $link nil? } " on this will evaluate elements as required." } ; HELP: lappend @@ -108,7 +108,7 @@ HELP: lappend { $description "Perform a similar functionality to that of the " { $link append } " word, but in a lazy manner. No evaluation of the list elements occurs initially but a " { $link } " object is returned which conforms to the list protocol. Calling " { $link car } ", " { $link cdr } " or " { $link nil? } " on this will evaluate elements as required. Successive calls to " { $link cdr } " will iterate through list1, followed by list2." } ; HELP: lfrom-by -{ $values { "n" "an integer" } { "quot" { $quotation "( n -- o )" } } { "lazy-from-by" "a lazy list of integers" } } +{ $values { "n" "an integer" } { "quot" { $quotation ( n -- o ) } } { "lazy-from-by" "a lazy list of integers" } } { $description "Return an infinite lazy list of values starting from n, with each successive value being the result of applying quot to the previous value." } ; HELP: lfrom @@ -140,11 +140,11 @@ HELP: lcartesian-product* { $description "Given a list of lists, return a list containing the cartesian product of those lists." } ; HELP: lcomp -{ $values { "list" "a list of lists" } { "quot" { $quotation "( seq -- X )" } } { "result" "the resulting list" } } +{ $values { "list" "a list of lists" } { "quot" { $quotation ( seq -- X ) } } { "result" "the resulting list" } } { $description "Get the cartesian product of the lists in " { $snippet "list" } " and call " { $snippet "quot" } " call with each element from the cartesian product on the stack, the result of which is returned in the final " { $snippet "list" } "." } ; HELP: lcomp* -{ $values { "list" "a list of lists" } { "guards" "a sequence of quotations with stack effect ( seq -- bool )" } { "quot" { $quotation "( seq -- X )" } } { "result" "a list" } } +{ $values { "list" "a list of lists" } { "guards" "a sequence of quotations with stack effect ( seq -- bool )" } { "quot" { $quotation ( seq -- X ) } } { "result" "a list" } } { $description "Get the cartesian product of the lists in " { $snippet "list" } ", filter it by applying each guard quotation to it and call " { $snippet "quot" } " call with each element from the remaining cartesian product items on the stack, the result of which is returned in the final " { $snippet "list" } "." } { $examples { $code "{ 1 2 3 } >list { 4 5 6 } >list 2list { [ first odd? ] } [ first2 + ] lcomp*" } diff --git a/basis/lists/lists-docs.factor b/basis/lists/lists-docs.factor index c22faa5c00..31e5329e98 100644 --- a/basis/lists/lists-docs.factor +++ b/basis/lists/lists-docs.factor @@ -127,19 +127,19 @@ HELP: unswons { leach foldl lmap>array } related-words HELP: leach -{ $values { "list" list } { "quot" { $quotation "( ... elt -- ... )" } } } +{ $values { "list" list } { "quot" { $quotation ( ... elt -- ... ) } } } { $description "Call the quotation for each item in the list." } ; HELP: foldl -{ $values { "list" list } { "identity" "an object" } { "quot" { $quotation "( ... prev elt -- ... next )" } } { "result" "the final result" } } +{ $values { "list" list } { "identity" "an object" } { "quot" { $quotation ( ... prev elt -- ... next ) } } { "result" "the final result" } } { $description "Combines successive elements of the list (in a left-associative order) using a binary operation and outputs the final result." } ; HELP: foldr -{ $values { "list" list } { "identity" "an object" } { "quot" { $quotation "( ... prev elt -- ... next )" } } { "result" "the final result" } } +{ $values { "list" list } { "identity" "an object" } { "quot" { $quotation ( ... prev elt -- ... next ) } } { "result" "the final result" } } { $description "Combines successive elements of the list (in a right-associative order) using a binary operation, and outputs the final result." } ; HELP: lmap -{ $values { "list" list } { "quot" { $quotation "( ... elt -- ... newelt )" } } { "result" "the final result" } } +{ $values { "list" list } { "quot" { $quotation ( ... elt -- ... newelt ) } } { "result" "the final result" } } { $description "Applies the quotation to each element of the list in order, collecting the new elements into a new list." } ; HELP: lreverse diff --git a/basis/math/combinatorics/combinatorics-docs.factor b/basis/math/combinatorics/combinatorics-docs.factor index 8b1665a6d2..776ab37916 100644 --- a/basis/math/combinatorics/combinatorics-docs.factor +++ b/basis/math/combinatorics/combinatorics-docs.factor @@ -53,7 +53,7 @@ HELP: all-permutations } ; HELP: each-permutation -{ $values { "seq" sequence } { "quot" { $quotation "( ... elt -- ... )" } } } +{ $values { "seq" sequence } { "quot" { $quotation ( ... elt -- ... ) } } } { $description "Applies the quotation to each permutation of " { $snippet "seq" } " in order." } ; HELP: inverse-permutation @@ -98,7 +98,7 @@ HELP: all-combinations }""" } } ; HELP: each-combination -{ $values { "seq" sequence } { "k" "a non-negative integer" } { "quot" { $quotation "( ... elt -- ... )" } } } +{ $values { "seq" sequence } { "k" "a non-negative integer" } { "quot" { $quotation ( ... elt -- ... ) } } } { $description "Applies the quotation to each combination of " { $snippet "seq" } " choosing " { $snippet "k" } " elements, in order." } ; diff --git a/basis/math/statistics/statistics-docs.factor b/basis/math/statistics/statistics-docs.factor index bab07f7190..f6e66793e9 100644 --- a/basis/math/statistics/statistics-docs.factor +++ b/basis/math/statistics/statistics-docs.factor @@ -94,7 +94,7 @@ HELP: histogram HELP: histogram-by { $values { "seq" sequence } - { "quot" { $quotation "( x -- bin )" } } + { "quot" { $quotation ( x -- bin ) } } { "hashtable" hashtable } } { $description "Returns a hashtable where the keys are the elements of the sequence binned by being passed through " { $snippet "quot" } ", and the values are the number of times members of each bin appeared in that sequence." } @@ -134,7 +134,7 @@ HELP: sorted-histogram HELP: sequence>assoc { $values - { "seq" sequence } { "map-quot" $quotation } { "insert-quot" quotation } { "exemplar" "an exemplar assoc" } + { "seq" sequence } { "map-quot" quotation } { "insert-quot" quotation } { "exemplar" "an exemplar assoc" } { "assoc" assoc } } { $description "Iterates over a sequence, allowing elements of the sequence to be added to a newly created " { $snippet "assoc" } ". The " { $snippet "map-quot" } " gets passed each element from the sequence. Its outputs are passed along with the assoc being constructed to the " { $snippet "insert-quot" } ", which can modify the assoc in response." } @@ -248,7 +248,7 @@ HELP: rescale HELP: collect-by { $values - { "seq" sequence } { "quot" { $quotation "( ... obj -- ... key )" } } + { "seq" sequence } { "quot" { $quotation ( ... obj -- ... key ) } } { "hashtable" hashtable } } { $description "Applies a quotation to each element in the input sequence and returns a " { $snippet "hashtable" } " of like elements. The keys of this " { $snippet "hashtable" } " are the output of " { $snippet "quot" } " and the values at each key are the elements that transformed to that key." } @@ -264,7 +264,7 @@ HELP: collect-by HELP: collect-index-by { $values - { "seq" sequence } { "quot" { $quotation "( ... obj -- ... key )" } } + { "seq" sequence } { "quot" { $quotation ( ... obj -- ... key ) } } { "hashtable" hashtable } } { $description "Applies a quotation to each element in the input sequence and returns a " { $snippet "hashtable" } " of like elements. The keys of this " { $snippet "hashtable" } " are the output of " { $snippet "quot" } " and the values at each key are the indices for the elements that transformed to that key." } diff --git a/basis/math/vectors/vectors-docs.factor b/basis/math/vectors/vectors-docs.factor index 0e0d05f5e9..86faa76d86 100644 --- a/basis/math/vectors/vectors-docs.factor +++ b/basis/math/vectors/vectors-docs.factor @@ -550,7 +550,7 @@ HELP: v? { $notes "See " { $link "math-vectors-simd-logic" } " for notes on dealing with vector boolean inputs and results when using SIMD types." } ; HELP: vif -{ $values { "mask" "a sequence of booleans" } { "true-quot" { $quotation "( -- vector )" } } { "false-quot" { $quotation "( -- vector )" } } { "result" "a sequence" } } +{ $values { "mask" "a sequence of booleans" } { "true-quot" { $quotation ( -- vector ) } } { "false-quot" { $quotation ( -- vector ) } } { "result" "a sequence" } } { $description "If all of the elements of " { $snippet "mask" } " are true, " { $snippet "true-quot" } " is called and its output value returned. If all of the elements of " { $snippet "mask" } " are false, " { $snippet "false-quot" } " is called and its output value returned. Otherwise, both quotations are called and " { $snippet "mask" } " is used to select elements from each output as with " { $link v? } "." } { $notes "See " { $link "math-vectors-simd-logic" } " for notes on dealing with vector boolean inputs and results when using SIMD types." $nl diff --git a/basis/models/arrow/arrow-docs.factor b/basis/models/arrow/arrow-docs.factor index 9bd6c4438d..2dbcda036f 100644 --- a/basis/models/arrow/arrow-docs.factor +++ b/basis/models/arrow/arrow-docs.factor @@ -15,7 +15,7 @@ HELP: arrow } ; HELP: -{ $values { "model" model } { "quot" { $quotation "( obj -- newobj )" } } { "arrow" "a new " { $link arrow } } } +{ $values { "model" model } { "quot" { $quotation ( obj -- newobj ) } } { "arrow" "a new " { $link arrow } } } { $description "Creates a new instance of " { $link arrow } ". The value of the new arrow model is computed by applying the quotation to the value." } { $examples "See the example in the documentation for " { $link arrow } "." } ; diff --git a/basis/models/arrow/smart/smart-docs.factor b/basis/models/arrow/smart/smart-docs.factor index b6d0ff4349..22f14c9fdc 100644 --- a/basis/models/arrow/smart/smart-docs.factor +++ b/basis/models/arrow/smart/smart-docs.factor @@ -2,7 +2,7 @@ IN: models.arrow.smart USING: help.syntax help.markup models.product ; HELP: -{ $values { "quot" { $quotation "( ... -- output )" } } } +{ $values { "quot" { $quotation ( ... -- output ) } } } { $description "A macro that expands into a form with the stack effect of the quotation. The form constructs a model which applies the quotation to values from an underlying " { $link product } " model having as many components as the quotation has inputs." } { $examples "A model which adds the values of two existing models:" @@ -18,4 +18,4 @@ ARTICLE: "models.arrow.smart" "Smart arrow models" "The " { $vocab-link "models.arrow.smart" } " vocabulary generalizes arrows to arbitrary input arity. They're called “smart” because they resemble " { $link "combinators.smart" } "." { $subsections } ; -ABOUT: "models.arrow.smart" \ No newline at end of file +ABOUT: "models.arrow.smart" diff --git a/basis/models/models-docs.factor b/basis/models/models-docs.factor index 480611b17d..aa0a8f3b87 100644 --- a/basis/models/models-docs.factor +++ b/basis/models/models-docs.factor @@ -71,15 +71,15 @@ HELP: ?set-model { set-model change-model change-model* (change-model) push-model pop-model } related-words HELP: change-model -{ $values { "model" model } { "quot" { $quotation "( ..a obj -- ..b newobj )" } } } +{ $values { "model" model } { "quot" { $quotation ( ..a obj -- ..b newobj ) } } } { $description "Applies the quotation to the current value of the model to yield a new value, then changes the value of the model to the new value, and calls " { $link model-changed } " on all observers registered with " { $link add-connection } "." } ; HELP: change-model* -{ $values { "model" model } { "quot" { $quotation "( ..a obj -- ..b )" } } } +{ $values { "model" model } { "quot" { $quotation ( ..a obj -- ..b ) } } } { $description "Applies the quotation to the current value of the model and calls " { $link model-changed } " on all observers registered with " { $link add-connection } " without actually changing the value of the model. This is useful for notifying observers of operations that mutate a value, as in " { $link push-model } " and " { $link pop-model } "." } ; HELP: (change-model) -{ $values { "model" model } { "quot" { $quotation "( ..a obj -- ..b newobj )" } } } +{ $values { "model" model } { "quot" { $quotation ( ..a obj -- ..b newobj ) } } } { $description "Applies the quotation to the current value of the model to yield a new value, then changes the value of the model to the new value without notifying any observers registered with " { $link add-connection } "." } { $notes "There are very few reasons for user code to call this word. Instead, call " { $link change-model } ", which notifies observers." } ; diff --git a/basis/peg/peg-docs.factor b/basis/peg/peg-docs.factor index 976c32d102..ee2fc78bb4 100644 --- a/basis/peg/peg-docs.factor +++ b/basis/peg/peg-docs.factor @@ -98,7 +98,7 @@ HELP: optional HELP: semantic { $values { "parser" "a parser" } - { "quot" { $quotation "( object -- ? )" } } + { "quot" { $quotation ( object -- ? ) } } } { $description "Returns a parser that succeeds if the 'p1' parser succeeds and the quotation called with " @@ -130,7 +130,7 @@ HELP: ensure-not HELP: action { $values { "parser" "a parser" } - { "quot" { $quotation "( ast -- ast )" } } + { "quot" { $quotation ( ast -- ast ) } } } { $description "Returns a parser that calls the 'p1' parser and applies the quotation to the AST resulting " diff --git a/basis/prettyprint/backend/backend-docs.factor b/basis/prettyprint/backend/backend-docs.factor index 556cdee0ee..324a4d2688 100644 --- a/basis/prettyprint/backend/backend-docs.factor +++ b/basis/prettyprint/backend/backend-docs.factor @@ -33,7 +33,7 @@ HELP: nesting-limit? $prettyprinting-note ; HELP: check-recursion -{ $values { "obj" "an object" } { "quot" { $quotation "( obj -- )" } } } +{ $values { "obj" "an object" } { "quot" { $quotation ( obj -- ) } } } { $description "If the object is already being printed, that is, if the prettyprinter has encountered a cycle in the object graph, or if the maximum nesting depth has been reached, outputs a dummy string. Otherwise applies the quotation to the object." } $prettyprinting-note ; diff --git a/basis/prettyprint/sections/sections-docs.factor b/basis/prettyprint/sections/sections-docs.factor index 0bf11454ab..ef90f9b9ef 100644 --- a/basis/prettyprint/sections/sections-docs.factor +++ b/basis/prettyprint/sections/sections-docs.factor @@ -144,7 +144,7 @@ HELP: save-end-position { $description "Save the current position as the end position of the block." } ; HELP: pprint-sections -{ $values { "block" block } { "advancer" { $quotation "( block -- )" } } } +{ $values { "block" block } { "advancer" { $quotation ( block -- ) } } } { $description "Prints child sections of a block, ignoring any " { $link line-break } " sections. The " { $snippet "advancer" } " quotation is called between every pair of sections." } ; HELP: do-break @@ -156,7 +156,7 @@ HELP: empty-block? { $description "Tests if the block has no child sections." } ; HELP: if-nonempty -{ $values { "block" block } { "quot" { $quotation "( block -- )" } } } +{ $values { "block" block } { "quot" { $quotation ( block -- ) } } } { $description "If the block has child sections, calls the quotation, otherwise does nothing." } ; HELP: ( +{ $values { "quot" { $quotation ( -- x ) } } { "promise" "a promise object" } } { $description "Creates a promise to return a value. When forced this quotation is called and the value returned. The value is memorised so that calling " { $link force } " again does not call the quotation again, instead the previous value is returned directly." } ; HELP: force @@ -12,7 +12,7 @@ HELP: force { $description "Calls the quotation associated with the promise if it has not been called before, and returns the value. If the promise has been forced previously, returns the value from the previous call." } ; HELP: LAZY: -{ $syntax "LAZY: word ( stack -- effect ) definition... ;" } +{ $syntax "LAZY: word ( stack -- effect ) definition... ;" } { $values { "word" "a new word to define" } { "definition" "a word definition" } } { $description "Creates a lazy word in the current vocabulary. When executed the word will return a " { $link promise } " that when forced, executes the word definition. Any values on the stack that are required by the word definition are captured along with the promise." } { $examples diff --git a/basis/regexp/regexp-docs.factor b/basis/regexp/regexp-docs.factor index 4c6ea1344d..54ba7db540 100644 --- a/basis/regexp/regexp-docs.factor +++ b/basis/regexp/regexp-docs.factor @@ -236,7 +236,7 @@ HELP: re-replace } ; HELP: re-replace-with -{ $values { "string" string } { "regexp" regexp } { "quot" { $quotation "( slice -- replacement )" } } { "result" string } } +{ $values { "string" string } { "regexp" regexp } { "quot" { $quotation ( slice -- replacement ) } } { "result" string } } { $description "Replaces substrings which match the input regexp with the result of calling " { $snippet "quot" } " on each matching slice. The boundaries of the substring are chosen by the strategy used by " { $link all-matching-slices } "." } { $examples { $example diff --git a/basis/sequences/deep/deep-docs.factor b/basis/sequences/deep/deep-docs.factor index 4d0b2e3699..5f75f0b237 100644 --- a/basis/sequences/deep/deep-docs.factor +++ b/basis/sequences/deep/deep-docs.factor @@ -2,31 +2,31 @@ USING: help.syntax help.markup kernel sequences ; IN: sequences.deep HELP: deep-each -{ $values { "obj" object } { "quot" { $quotation "( ... elt -- ... )" } } } +{ $values { "obj" object } { "quot" { $quotation ( ... elt -- ... ) } } } { $description "Execute a quotation on each nested element of an object and its children, in preorder." } { $see-also each } ; HELP: deep-map -{ $values { "obj" object } { "quot" { $quotation "( ... elt -- ... elt' )" } } { "newobj" "the mapped object" } } +{ $values { "obj" object } { "quot" { $quotation ( ... elt -- ... elt' ) } } { "newobj" "the mapped object" } } { $description "Execute a quotation on each nested element of an object and its children, in preorder. That is, the result of the execution of the quotation on the outer is used to map the inner elements." } { $see-also map } ; HELP: deep-filter-as -{ $values { "obj" object } { "quot" { $quotation "( ... elt -- ... ? )" } } { "exemplar" sequence } { "seq" sequence } } +{ $values { "obj" object } { "quot" { $quotation ( ... elt -- ... ? ) } } { "exemplar" sequence } { "seq" sequence } } { $description "Creates a sequence (of the same type as " { $snippet "exemplar" } ") of sub-nodes in the object which satisfy the given quotation, in preorder. This includes the object itself, if it passes the quotation." } ; HELP: deep-filter -{ $values { "obj" object } { "quot" { $quotation "( ... elt -- ... ? )" } } { "seq" sequence } } +{ $values { "obj" object } { "quot" { $quotation ( ... elt -- ... ? ) } } { "seq" sequence } } { $description "Creates a sequence of sub-nodes in the object which satisfy the given quotation, in preorder. This includes the object itself, if it passes the quotation." } { $see-also filter } ; HELP: deep-find -{ $values { "obj" object } { "quot" { $quotation "( ... elt -- ... ? )" } } { "elt" "an element" } } +{ $values { "obj" object } { "quot" { $quotation ( ... elt -- ... ? ) } } { "elt" "an element" } } { $description "Gets the first sub-node of the object, in preorder, which satisfies the quotation. If nothing satisfies it, it returns " { $link f } "." } { $see-also find } ; HELP: deep-any? -{ $values { "obj" object } { "quot" { $quotation "( ... elt -- ... ? )" } } { "?" "a boolean" } } +{ $values { "obj" object } { "quot" { $quotation ( ... elt -- ... ? ) } } { "?" "a boolean" } } { $description "Tests whether the given object or any subnode satisfies the given quotation." } { $see-also any? } ; @@ -39,7 +39,7 @@ HELP: flatten { $description "Creates a sequence of all of the leaf nodes (non-sequence nodes, but including strings and numbers) in the object." } ; HELP: deep-map! -{ $values { "obj" object } { "quot" { $quotation "( ... elt -- ... elt' )" } } } +{ $values { "obj" object } { "quot" { $quotation ( ... elt -- ... elt' ) } } } { $description "Modifies each sub-node of an object in place, in preorder, and returns that object." } { $see-also map! } ; diff --git a/basis/sequences/generalizations/generalizations-docs.factor b/basis/sequences/generalizations/generalizations-docs.factor index 26ddc08027..5ecebe44d4 100644 --- a/basis/sequences/generalizations/generalizations-docs.factor +++ b/basis/sequences/generalizations/generalizations-docs.factor @@ -83,47 +83,47 @@ HELP: nappend-as { nappend nappend-as } related-words HELP: neach -{ $values { "seq..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation "( element... -- )" } } { "n" integer } } +{ $values { "seq..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation ( element... -- ) } } { "n" integer } } { $description "A generalization of " { $link each } ", " { $link 2each } ", and " { $link 3each } " that can iterate over any number of sequences in parallel." } ; HELP: nmap -{ $values { "seq..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation "( element... -- result )" } } { "n" integer } { "result" "a sequence of the same type as the first " { $snippet "seq" } } } +{ $values { "seq..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation ( element... -- result ) } } { "n" integer } { "result" "a sequence of the same type as the first " { $snippet "seq" } } } { $description "A generalization of " { $link map } ", " { $link 2map } ", and " { $link 3map } " that can map over any number of sequences in parallel." } ; HELP: nmap-as -{ $values { "seq..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation "( element... -- result )" } } { "exemplar" sequence } { "n" integer } { "result" "a sequence of the same type as " { $snippet "exemplar" } } } +{ $values { "seq..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation ( element... -- result ) } } { "exemplar" sequence } { "n" integer } { "result" "a sequence of the same type as " { $snippet "exemplar" } } } { $description "A generalization of " { $link map-as } ", " { $link 2map-as } ", and " { $link 3map-as } " that can map over any number of sequences in parallel." } ; HELP: mnmap -{ $values { "m*seq" { $snippet "m" } " sequences on the datastack" } { "quot" { $quotation "( m*element -- result*n )" } } { "m" integer } { "n" integer } { "result*n" { $snippet "n" } " sequences of the same type as the first " { $snippet "seq" } } } +{ $values { "m*seq" { $snippet "m" } " sequences on the datastack" } { "quot" { $quotation ( m*element -- result*n ) } } { "m" integer } { "n" integer } { "result*n" { $snippet "n" } " sequences of the same type as the first " { $snippet "seq" } } } { $description "A generalization of " { $link map } ", " { $link 2map } ", and " { $link 3map } " that can map over any number of sequences in parallel and provide any number of output sequences." } ; HELP: mnmap-as -{ $values { "m*seq" { $snippet "m" } " sequences on the datastack" } { "quot" { $quotation "( m*element -- result*n )" } } { "n*exemplar" { $snippet "n" } " sequences on the datastack" } { "m" integer } { "n" integer } { "result*n" { $snippet "n" } " sequences on the datastack of the same types as the " { $snippet "exemplar" } "s" } } +{ $values { "m*seq" { $snippet "m" } " sequences on the datastack" } { "quot" { $quotation ( m*element -- result*n ) } } { "n*exemplar" { $snippet "n" } " sequences on the datastack" } { "m" integer } { "n" integer } { "result*n" { $snippet "n" } " sequences on the datastack of the same types as the " { $snippet "exemplar" } "s" } } { $description "A generalization of " { $link map-as } ", " { $link 2map-as } ", and " { $link 3map-as } " that can map over any number of sequences in parallel and provide any number of output sequences of distinct types." } ; HELP: nproduce -{ $values { "pred" { $quotation "( -- ? )" } } { "quot" { $quotation "( -- obj1 obj2 ... objn )" } } { "n" integer } { "seq..." { $snippet "n" } " arrays on the datastack" } } +{ $values { "pred" { $quotation ( -- ? ) } } { "quot" { $quotation "( -- obj1 obj2 ... objn )" } } { "n" integer } { "seq..." { $snippet "n" } " arrays on the datastack" } } { $description "A generalization of " { $link produce } " that generates " { $snippet "n" } " arrays in parallel by calling " { $snippet "quot" } " repeatedly until " { $snippet "pred" } " outputs false." } ; HELP: nproduce-as -{ $values { "pred" { $quotation "( -- ? )" } } { "quot" { $quotation "( -- obj1 obj2 ... objn )" } } { "exemplar..." { $snippet "n" } " sequences on the datastack" } { "n" integer } { "seq..." { $snippet "n" } " sequences on the datastack of the same types as the " { $snippet "exemplar" } "s" } } +{ $values { "pred" { $quotation ( -- ? ) } } { "quot" { $quotation "( -- obj1 obj2 ... objn )" } } { "exemplar..." { $snippet "n" } " sequences on the datastack" } { "n" integer } { "seq..." { $snippet "n" } " sequences on the datastack of the same types as the " { $snippet "exemplar" } "s" } } { $description "A generalization of " { $link produce-as } " that generates " { $snippet "n" } " sequences in parallel by calling " { $snippet "quot" } " repeatedly until " { $snippet "pred" } " outputs false." } ; HELP: nmap-reduce -{ $values { "map-quot" { $quotation "( element... -- intermediate )" } } { "reduce-quot" { $quotation "( prev intermediate -- next )" } } { "n" integer } } +{ $values { "map-quot" { $quotation ( element... -- intermediate ) } } { "reduce-quot" { $quotation ( prev intermediate -- next ) } } { "n" integer } } { $description "A generalization of " { $link map-reduce } " that can be applied to any number of sequences." } ; HELP: nall? -{ $values { "seqs..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation "( element... - ? )" } } { "n" integer } { "?" boolean } } +{ $values { "seqs..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation ( element... -- ? ) } } { "n" integer } { "?" boolean } } { $description "A generalization of " { $link all? } " that can be applied to any number of sequences." } ; HELP: nfind -{ $values { "seqs..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation "( element... - ? )" } } { "n" integer } { "i" integer } { "elts..." { $snippet "n" } " elements on the datastack" } } +{ $values { "seqs..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation ( element... -- ? ) } } { "n" integer } { "i" integer } { "elts..." { $snippet "n" } " elements on the datastack" } } { $description "A generalization of " { $link find } " that can be applied to any number of sequences." } ; HELP: nany? -{ $values { "seqs..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation "( element... - ? )" } } { "n" integer } { "?" boolean } } +{ $values { "seqs..." { $snippet "n" } " sequences on the datastack" } { "quot" { $quotation ( element... -- ? ) } } { "n" integer } { "?" boolean } } { $description "A generalization of " { $link any? } " that can be applied to any number of sequences." } ; ARTICLE: "sequences.generalizations" "Generalized sequence words" diff --git a/basis/sequences/product/product-docs.factor b/basis/sequences/product/product-docs.factor index ac26089814..854911ae18 100644 --- a/basis/sequences/product/product-docs.factor +++ b/basis/sequences/product/product-docs.factor @@ -40,20 +40,20 @@ HELP: { product-sequence } related-words HELP: product-map -{ $values { "sequences" sequence } { "quot" { $quotation "( ... seq -- ... value )" } } { "sequence" sequence } } +{ $values { "sequences" sequence } { "quot" { $quotation ( ... seq -- ... value ) } } { "sequence" sequence } } { $description "Calls " { $snippet "quot" } " for every element of the cartesian product of " { $snippet "sequences" } " and collects the results from " { $snippet "quot" } " into an output sequence." } { $notes { $snippet "[ ... ] product-map" } " is equivalent to, but more efficient than, " { $snippet " [ ... ] map" } "." } ; HELP: product-map-as -{ $values { "sequences" sequence } { "quot" { $quotation "( ... seq -- ... value )" } } { "exemplar" sequence } { "sequence" sequence } } +{ $values { "sequences" sequence } { "quot" { $quotation ( ... seq -- ... value ) } } { "exemplar" sequence } { "sequence" sequence } } { $description "Calls " { $snippet "quot" } " for every element of the cartesian product of " { $snippet "sequences" } " and collects the results from " { $snippet "quot" } " into an output sequence the same type as the " { $snippet "exemplar" } " sequence." } ; HELP: product-map>assoc -{ $values { "sequences" sequence } { "quot" { $quotation "( ... seq -- ... key value )" } } { "exemplar" assoc } { "assoc" assoc } } +{ $values { "sequences" sequence } { "quot" { $quotation ( ... seq -- ... key value ) } } { "exemplar" assoc } { "assoc" assoc } } { $description "Calls " { $snippet "quot" } " for every element of the cartesian product of " { $snippet "sequences" } " and collects the results from " { $snippet "quot" } " into an output assoc." } ; HELP: product-each -{ $values { "sequences" sequence } { "quot" { $quotation "( ... seq -- ... )" } } } +{ $values { "sequences" sequence } { "quot" { $quotation ( ... seq -- ... ) } } } { $description "Calls " { $snippet "quot" } " for every element of the cartesian product of " { $snippet "sequences" } "." } { $notes { $snippet "[ ... ] product-each" } " is equivalent to, but more efficient than, " { $snippet " [ ... ] each" } "." } ; diff --git a/basis/sequences/unrolled/unrolled-docs.factor b/basis/sequences/unrolled/unrolled-docs.factor index 1e6ba39897..3d41426f7c 100644 --- a/basis/sequences/unrolled/unrolled-docs.factor +++ b/basis/sequences/unrolled/unrolled-docs.factor @@ -5,70 +5,70 @@ IN: sequences.unrolled HELP: unrolled-collect { $values - { "n" integer } { "quot" { $quotation "( n -- value )" } } { "into" sequence } + { "n" integer } { "quot" { $quotation ( n -- value ) } } { "into" sequence } } { $description "Unrolled version of " { $link collect } ". " { $snippet "n" } " must be a compile-time constant." } ; HELP: unrolled-each { $values - { "seq" sequence } { "len" integer } { "quot" { $quotation "( x -- )" } } + { "seq" sequence } { "len" integer } { "quot" { $quotation ( x -- ) } } } { $description "Unrolled version of " { $link each } " that iterates over the first " { $snippet "len" } " elements of " { $snippet "seq" } ". " { $snippet "len" } " must be a compile-time constant. If " { $snippet "seq" } " has fewer than " { $snippet "len" } " elements, raises an " { $link unrolled-bounds-error } "." } ; HELP: unrolled-2each { $values - { "xseq" sequence } { "yseq" sequence } { "len" integer } { "quot" { $quotation "( x y -- )" } } + { "xseq" sequence } { "yseq" sequence } { "len" integer } { "quot" { $quotation ( x y -- ) } } } { $description "Unrolled version of " { $link 2each } " that iterates over the first " { $snippet "len" } " elements of " { $snippet "xseq" } " and " { $snippet "yseq" } ". " { $snippet "len" } " must be a compile-time constant. If " { $snippet "seq" } " has fewer than " { $snippet "len" } " elements, raises an " { $link unrolled-bounds-error } "." } ; HELP: unrolled-each-index { $values - { "seq" sequence } { "len" integer } { "quot" { $quotation "( x i -- )" } } + { "seq" sequence } { "len" integer } { "quot" { $quotation ( x i -- ) } } } { $description "Unrolled version of " { $link each-index } " that iterates over the first " { $snippet "len" } " elements of " { $snippet "seq" } ". " { $snippet "len" } " must be a compile-time constant. If " { $snippet "seq" } " has fewer than " { $snippet "len" } " elements, raises an " { $link unrolled-bounds-error } "." } ; HELP: unrolled-each-integer { $values - { "n" integer } { "quot" { $quotation "( i -- )" } } + { "n" integer } { "quot" { $quotation ( i -- ) } } } { $description "Unrolled version of " { $link each-integer } ". " { $snippet "n" } " must be a compile-time constant." } ; HELP: unrolled-map { $values - { "seq" sequence } { "len" integer } { "quot" { $quotation "( x -- newx )" } } + { "seq" sequence } { "len" integer } { "quot" { $quotation ( x -- newx ) } } { "newseq" sequence } } { $description "Unrolled version of " { $link map } " that maps over the first " { $snippet "len" } " elements of " { $snippet "seq" } ". " { $snippet "len" } " must be a compile-time constant. If " { $snippet "seq" } " has fewer than " { $snippet "len" } " elements, raises an " { $link unrolled-bounds-error } "." } ; HELP: unrolled-map-as { $values - { "seq" sequence } { "len" integer } { "quot" { $quotation "( x -- newx )" } } { "exemplar" sequence } + { "seq" sequence } { "len" integer } { "quot" { $quotation ( x -- newx ) } } { "exemplar" sequence } { "newseq" sequence } } { $description "Unrolled version of " { $link map-as } " that maps over the first " { $snippet "len" } " elements of " { $snippet "seq" } ". " { $snippet "len" } " must be a compile-time constant. If " { $snippet "seq" } " has fewer than " { $snippet "len" } " elements, raises an " { $link unrolled-bounds-error } "." } ; HELP: unrolled-2map { $values - { "xseq" sequence } { "yseq" sequence } { "len" integer } { "quot" { $quotation "( x y -- newx )" } } { "newseq" sequence } + { "xseq" sequence } { "yseq" sequence } { "len" integer } { "quot" { $quotation ( x y -- newx ) } } { "newseq" sequence } } { $description "Unrolled version of " { $link 2map } " that iterates over the first " { $snippet "len" } " elements of " { $snippet "xseq" } " and " { $snippet "yseq" } ". " { $snippet "len" } " must be a compile-time constant. If " { $snippet "seq" } " has fewer than " { $snippet "len" } " elements, raises an " { $link unrolled-bounds-error } "." } ; HELP: unrolled-2map-as { $values - { "xseq" sequence } { "yseq" sequence } { "len" integer } { "quot" { $quotation "( x y -- newx )" } } { "exemplar" sequence } { "newseq" sequence } + { "xseq" sequence } { "yseq" sequence } { "len" integer } { "quot" { $quotation ( x y -- newx ) } } { "exemplar" sequence } { "newseq" sequence } } { $description "Unrolled version of " { $link 2map-as } " that iterates over the first " { $snippet "len" } " elements of " { $snippet "xseq" } " and " { $snippet "yseq" } ". " { $snippet "len" } " must be a compile-time constant. If " { $snippet "seq" } " has fewer than " { $snippet "len" } " elements, raises an " { $link unrolled-bounds-error } "." } ; HELP: unrolled-map-index { $values - { "seq" sequence } { "len" integer } { "quot" { $quotation "( x i -- newx )" } } + { "seq" sequence } { "len" integer } { "quot" { $quotation ( x i -- newx ) } } { "newseq" sequence } } { $description "Unrolled version of " { $link map-index } " that maps over the first " { $snippet "len" } " elements of " { $snippet "seq" } ". " { $snippet "len" } " must be a compile-time constant. If " { $snippet "seq" } " has fewer than " { $snippet "len" } " elements, raises an " { $link unrolled-bounds-error } "." } ; HELP: unrolled-map-integers { $values - { "n" integer } { "quot" { $quotation "( n -- value )" } } { "exemplar" sequence } { "newseq" sequence } + { "n" integer } { "quot" { $quotation ( n -- value ) } } { "exemplar" sequence } { "newseq" sequence } } { $description "Unrolled version of " { $link map-integers } ". " { $snippet "n" } " must be a compile-time constant." } ; diff --git a/basis/threads/threads-docs.factor b/basis/threads/threads-docs.factor index b209626c0d..7d58d6f635 100644 --- a/basis/threads/threads-docs.factor +++ b/basis/threads/threads-docs.factor @@ -175,7 +175,7 @@ $nl } ; HELP: spawn-server -{ $values { "quot" { $quotation "( -- ? )" } } { "name" string } { "thread" thread } } +{ $values { "quot" { $quotation ( -- ? ) } } { "name" string } { "thread" thread } } { $description "Convenience wrapper around " { $link spawn } " which repeatedly calls the quotation in a new thread until it outputs " { $link f } "." } { $examples "A thread that runs forever:" @@ -198,5 +198,5 @@ HELP: tset { $description "Sets the value of a thread-local variable." } ; HELP: tchange -{ $values { "key" object } { "quot" { $quotation "( ..a value -- ..b newvalue )" } } } +{ $values { "key" object } { "quot" { $quotation ( ..a value -- ..b newvalue ) } } } { $description "Applies the quotation to the current value of a thread-local variable, storing the result back to the same variable." } ; diff --git a/basis/tools/annotations/annotations-docs.factor b/basis/tools/annotations/annotations-docs.factor index 43fc3af129..6391c1175c 100644 --- a/basis/tools/annotations/annotations-docs.factor +++ b/basis/tools/annotations/annotations-docs.factor @@ -25,7 +25,7 @@ $nl ABOUT: "tools.annotations" HELP: annotate -{ $values { "word" "a word" } { "quot" { $quotation "( old-def -- new-def )" } } } +{ $values { "word" "a word" } { "quot" { $quotation ( old-def -- new-def ) } } } { $description "Changes a word definition to the result of applying a quotation to the old definition." } { $notes "This word is used to implement " { $link watch } "." } ; diff --git a/basis/tools/test/test-docs.factor b/basis/tools/test/test-docs.factor index e1e9068722..dcc029931a 100644 --- a/basis/tools/test/test-docs.factor +++ b/basis/tools/test/test-docs.factor @@ -63,7 +63,7 @@ HELP: must-fail { $notes "This word is used to test boundary conditions and fail-fast behavior." } ; HELP: must-fail-with -{ $values { "quot" "a quotation run with an empty stack" } { "pred" { $quotation "( error -- ? )" } } } +{ $values { "quot" "a quotation run with an empty stack" } { "pred" { $quotation ( error -- ? ) } } } { $description "Runs a quotation with an empty stack, expecting it to throw an error which must satisfy " { $snippet "pred" } ". If the quotation does not throw an error, or if the error does not match the predicate, the unit test fails." } { $notes "This word is used to test error handling code, ensuring that errors thrown by code contain the relevant debugging information." } ; diff --git a/basis/tools/walker/walker-docs.factor b/basis/tools/walker/walker-docs.factor index 6571afc64a..94c1a7790d 100644 --- a/basis/tools/walker/walker-docs.factor +++ b/basis/tools/walker/walker-docs.factor @@ -11,7 +11,7 @@ HELP: breakpoint } ; HELP: breakpoint-if -{ $values { "word" word } { "quot" { $quotation "( -- ? )" } } } +{ $values { "word" word } { "quot" { $quotation ( -- ? ) } } } { $description "Annotates a word definition to enter the single stepper if the quotation yields true. The quotation has access to the datastack as it exists just before " { $snippet "word" } " is called." } { $examples "Break if the input to sq is 3:" diff --git a/basis/ui/gadgets/buttons/buttons-docs.factor b/basis/ui/gadgets/buttons/buttons-docs.factor index f39d45b978..3fb40b90a6 100644 --- a/basis/ui/gadgets/buttons/buttons-docs.factor +++ b/basis/ui/gadgets/buttons/buttons-docs.factor @@ -12,19 +12,19 @@ $nl "A button can optionally display a message in the window's status bar whenever the mouse cursor hovers over the button. To enable this behavior, just set a string to the button's " { $snippet "tooltip" } " slot." } ; HELP: