Permalink
Browse files

update some docs that should use $quotation.

  • Loading branch information...
1 parent c10a656 commit 50ffb0c2d1d03c1c1771a0eb4e70e1db8134c1ad @mrjbq7 mrjbq7 committed Sep 27, 2012
@@ -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"
@@ -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
@@ -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" }
} } ;
@@ -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" } "." } ;
@@ -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." }
@@ -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,24 +30,24 @@ 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 }
;
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 } ;
+{ $see-also amb-all } ;
@@ -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 }
;
@@ -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 "
@@ -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

0 comments on commit 50ffb0c

Please sign in to comment.