]> gitweb.factorcode.org Git - factor.git/commitdiff
update some docs that should use $quotation.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 27 Sep 2012 18:09:17 +0000 (11:09 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 27 Sep 2012 18:09:17 +0000 (11:09 -0700)
basis/sequences/generalizations/generalizations-docs.factor
basis/ui/gadgets/presentations/presentations-docs.factor
basis/ui/operations/operations-docs.factor
core/graphs/graphs-docs.factor
core/sequences/sequences-docs.factor
extra/backtrack/backtrack-docs.factor
extra/coroutines/coroutines-docs.factor
extra/path-finding/path-finding-docs.factor
extra/readline/readline-docs.factor

index fbee36655e7a36752dfec85dab6395245c1ead01..9ceff0c6edee6dfa733f2075893d29aee90c8b4b 100644 (file)
@@ -83,23 +83,23 @@ HELP: nappend-as
 { nappend nappend-as } related-words
 
 HELP: neach
-{ $values { "seq..." { $snippet "n" } " sequences on the datastack" } { "quot" "a quotation with stack effect " { $snippet "( 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" "a quotation with stack effect " { $snippet "( 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" "a quotation with stack effect " { $snippet "( 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" "a quotation with stack effect " { $snippet "( 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" "a quotation with stack effect " { $snippet "( 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
@@ -111,7 +111,7 @@ HELP: nproduce-as
 { $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 } { "reduce-quot" quotation } { "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." } ;
 
 ARTICLE: "sequences.generalizations" "Generalized sequence words"
index 3404f1d7f63679ab0c35d6582e6bda551a7f10f6..81f0e4565d6605084533411e25bf0df3859d0538 100644 (file)
@@ -11,7 +11,7 @@ $nl
 "Presentations have two slots:"
 { $list
     { { $snippet "object" } " - the object being presented." }
-    { { $snippet "hook" } " - a quotation with stack effect " { $snippet "( presentation -- )" } ". The default value is " { $snippet "[ drop ]" } "." }
+    { { $snippet "hook" } " - " { $quotation "( presentation -- )" } ". The default value is " { $snippet "[ drop ]" } "." }
 } } ;
 
 HELP: invoke-presentation
index 31f0b123d04ac2163c75a8b2dbb2cd8253fc41dc..0680df449194bd3e8ddf535059f5828b1d7115c7 100644 (file)
@@ -22,10 +22,10 @@ HELP: operation
 $nl
 "Operations have the following slots:"
 { $list
-    { { $snippet "predicate" } " - a quotation with stack effect " { $snippet "( obj -- ? )" } }
+    { { $snippet "predicate" } " - " { $quotation "( obj -- ? )" } }
     { { $snippet "command" } " - a " { $link word } }
-    { { $snippet "translator" } " - a quotation with stack effect " { $snippet "( obj -- newobj )" } ", or " { $link f } }
-    { { $snippet "hook" } " - a quotation with stack effect " { $snippet "( obj -- newobj )" } ", or " { $link f } }
+    { { $snippet "translator" } " - " { $quotation "( obj -- newobj )" } ", or " { $link f } }
+    { { $snippet "hook" } " - " { $quotation "( obj -- newobj )" } ", or " { $link f } }
     { { $snippet "listener?" } " - a boolean" }
 } } ;
 
index 830d8648236e4c3aa09e0923349ee833dd5536e5..a08a2a5bf93dce0144277af891cdb28a3f034368 100644 (file)
@@ -1,5 +1,5 @@
+USING: assocs hashtables help.markup help.syntax kernel sequences ;
 IN: graphs
-USING: help.markup help.syntax kernel assocs hashtables ;
 
 ARTICLE: "graphs" "Directed graph utilities"
 "Words for treating associative mappings as directed graphs can be found in the " { $vocab-link "graphs" } " vocabulary. A directed graph is represented as an assoc mapping each vertex to a set of edges entering that vertex, where the set is itself an assoc, with equal keys and values."
@@ -17,16 +17,16 @@ $nl
 ABOUT: "graphs"
 
 HELP: add-vertex
-{ $values { "vertex" object } { "edges" "a sequence" } { "graph" "an assoc mapping vertices to sequences of edges" } }
+{ $values { "vertex" object } { "edges" sequence } { "graph" "an assoc mapping vertices to sequences of edges" } }
 { $description "Adds a vertex to a directed graph, with " { $snippet "edges" } "  as the outward edges from the vertex." }
 { $side-effects "graph" } ;
 
 HELP: remove-vertex
-{ $values { "vertex" object } { "edges" "a sequence" } { "graph" "an assoc mapping vertices to sequences of edges" } }
+{ $values { "vertex" object } { "edges" sequence } { "graph" "an assoc mapping vertices to sequences of edges" } }
 { $description "Removes a vertex from a graph, using the given edges sequence." } 
 { $notes "The " { $snippet "edges" } " sequence must equal the value passed to " { $link add-vertex } ", otherwise some vertices of the graph may continue to refer to the removed vertex." }
 { $side-effects "graph" } ;
 
 HELP: closure
-{ $values { "obj" object } { "quot" "a a quotation with stack effect " { $snippet "( obj -- assoc )" } } { "assoc" "a new assoc" } }
+{ $values { "obj" object } { "quot" { $quotation "( obj -- 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" } "." } ;
index bf9de6d0ba1b3dd6ee16943da7e05953c5fb1c61..84522ec46a91d071a5a2f5b9083ecb9c8215e428 100644 (file)
@@ -1344,7 +1344,7 @@ HELP: insert-nth
 
 HELP: map-reduce
 { $values
-     { "seq" sequence } { "map-quot" quotation } { "reduce-quot" quotation }
+     { "seq" sequence } { "map-quot" { $quotation "( ..a x -- ..b elt )" } } { "reduce-quot" { $quotation "( ..b prev elt -- ..a next )" } }
      { "result" object } }
 { $description "Calls " { $snippet "map-quot" } " on each element and combines the results using " { $snippet "reduce-quot" } " in the same manner as " { $link reduce } ", except that there is no identity element, and the sequence must have a length of at least 1." }
 { $errors "Throws an error if the sequence is empty." }
index c654ac234f596bb0ce7815a38d4957e41dd98920..2eec49a592f72e556589a86d6626b392c3d638f1 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (c) 2009 Samuel Tardieu.
 ! See See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax ;
+USING: help.markup help.syntax quotations sequences ;
 IN: backtrack
 
 HELP: fail
@@ -30,15 +30,15 @@ HELP: amb-execute
 
 HELP: if-amb
 { $values
-  { "true" "a quotation with stack effect ( -- ? )" }
-  { "false" "a quotation" }
+  { "true" { $quotation "( -- ? )" } }
+  { "false" quotation }
   { "?" "a boolean" }
 }
 { $description "Execute the first quotation and returns " { $link t } " if it returns " { $link t } " itself. If it fails with " { $link fail } " or returns " { $link f } ", then the second quotation is executed and " { $link f } " is returned." } ;
 
 HELP: amb-all
 { $values
-  { "quot" "a quotation with stack effect ( -- )" }
+  { "quot" { $quotation "( -- )" } }
 }
 { $description "Execute all the alternatives in the quotation by calling " { $link fail } " repeatedly at the end." }
 { $see-also bag-of fail }
@@ -46,8 +46,8 @@ HELP: amb-all
 
 HELP: bag-of
 { $values
-  { "quot" "a quotation with stack effect ( -- result )" }
-  { "seq" "a sequence" }
+  { "quot" { $quotation "( -- result )" } }
+  { "seq" sequence }
 }
 { $description "Execute all the alternatives in the quotation and collect the results." }
-{ $see-also amb-all } ;
\ No newline at end of file
+{ $see-also amb-all } ;
index 6c6bffa64da44b8b482e2bca14a12efc5968b276..e12e29dc23c2217b9cfdf73f43266fdeed539ef6 100644 (file)
@@ -1,56 +1,56 @@
 ! Copyright (C) 2005 Chris Double, 2007 Clemens Hofreither, 2008 James Cash.
-USING: help.markup help.syntax ;
+USING: help.markup help.syntax kernel ;
 IN: coroutines
 
 HELP: cocreate
-{ $values { "quot" "a quotation with stack effect ( value -- )" } { "co" "a coroutine" } }
+{ $values { "quot" { $quotation "( value -- )" } } { "co" coroutine } }
 { $description "Create a new coroutine which will execute the quotation when resumed. The quotation will have an initial value (received from " { $link coresume } ") on the stack when first resumed.\n\nCoroutines should never terminate normally by \"falling off\" the end of the quotation; instead, they should call " { $link coterminate } "." }
 ;
 
 HELP: coresume
-{ $values { "v" "an object" } { "co" "a coroutine" } { "result" "an object" } }
+{ $values { "v" object } { "co" coroutine } { "result" object } }
 { $description "Resume a coroutine with v as the first item on the stack. The result placed on the stack is the value of the topmost argument on the stack when " { $link coyield } " is called within the coroutine." }
 { $see-also *coresume coresume* }
 ;
 
 HELP: *coresume
-{ $values { "co" "a coroutine" } { "result" "an object" } }
+{ $values { "co" coroutine } { "result" object } }
 { $description "Variant of " { $link coresume } " that passes a default value of " { $link f } " to the coroutine." }
 { $see-also coresume coresume* }
 ;
 
 HELP: coresume*
-{ $values { "v" "an object" } { "co" "a coroutine" } }
+{ $values { "v" object } { "co" coroutine } }
 { $description "Variant of " { $link coresume } " that discards the result of the coroutine invocation." }
 { $see-also coresume *coresume }
 ;
 
 HELP: coyield
-{ $values { "v" "an object" } { "result" "an object" } }
+{ $values { "v" object } { "result" object } }
 { $description "Suspend the current coroutine, leaving the value v on the stack when control is passed to the " { $link coresume } " caller. When this coroutine is later resumed, result will contain the value passed to " { $link coyield } "." }
 { $see-also *coyield coyield* coterminate }
 ;
 
 HELP: *coyield
-{ $values { "v" "an object" } }
+{ $values { "v" object } }
 { $description "Variant of " { $link coyield } " that returns a default value of " { $link f } " to the caller." }
 { $see-also coyield coyield* }
 ;
 
 HELP: coyield*
-{ $values { "v" "an object" } }
+{ $values { "v" object } }
 { $description "Variant of " { $link coyield } " that discards the value passed in via " { $link coresume } "." }
 { $see-also coyield *coyield }
 ;
 
 HELP: coterminate
-{ $values { "v" "an object" } }
+{ $values { "v" object } }
 { $description "Terminate the current coroutine, leaving the value v on the stack when control is passed to the " { $link coresume } " caller. Resuming a terminated coroutine is a no-op." }
 { $see-also coyield coreset }
 ;
 
 HELP: coreset
-{ $values { "v" "an object" } }
+{ $values { "v" object } }
 { $description "Reset the current coroutine, leaving the value v on the stack when control is passed to the " { $link coresume } " caller. When the coroutine is resumed, it will continue at the beginning of the coroutine." }
 { $see-also coyield coterminate }
 ;
index c282aa1dc0e596cbfcbb4c18a7870d776295f052..e5a969dfcfaa908a5674c9958028a53a953a5279 100644 (file)
@@ -42,9 +42,9 @@ HELP: neighbours
 
 HELP: <astar>
 { $values
-  { "neighbours" "a quotation with stack effect ( node -- seq )" }
-  { "cost" "a quotation with stack effect ( from to -- cost )" }
-  { "heuristic" "a quotation with stack effect ( pos target -- cost )" }
+  { "neighbours" { $quotation "( node -- seq )" } }
+  { "cost" { $quotation "( from to -- cost )" } }
+  { "heuristic" { $quotation "( pos target -- cost )" } }
   { "astar" astar }
 }
 { $description "Build an astar object from the given quotations. The "
index f1082de9547bfed06acea08af7ff7d43ecccdcfb..e16eace7c08fd7299347b7b30336c7bf16c52c84 100644 (file)
@@ -14,7 +14,7 @@ HELP: readline
 
 HELP: set-completion
 { $values
-    { "quot" "a quotation with stack effect ( str n -- str )"}
+    { "quot" { $quotation "( str n -- str )" } }
 }
 { $description "Set the given quotation as the completion hook for readline. The quotation is called with the string to complete and the index in the completion list to return. When all completions have been returned, returning " { $snippet "f" } " terminates the loop." }
 { $examples