]> gitweb.factorcode.org Git - factor.git/blob - basis/sequences/deep/deep-docs.factor
Create basis vocab root
[factor.git] / basis / sequences / deep / deep-docs.factor
1 USING: help.syntax help.markup ;
2 IN: sequences.deep
3
4 HELP: deep-each
5 { $values { "obj" "an object" } { "quot" "a quotation ( elt -- ) " } }
6 { $description "Execute a quotation on each nested element of an object and its children, in preorder." } ;
7
8 HELP: deep-map
9 { $values { "obj" "an object" } { "quot" "a quotation ( elt -- newelt )" } { "newobj" "the mapped object" } }
10 { $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." } ;
11
12 HELP: deep-filter
13 { $values { "obj" "an object" } { "quot" "a quotation ( elt -- ? )" } { "seq" "a sequence" } }
14 { $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." } ;
15
16 HELP: deep-find
17 { $values { "obj" "an object" } { "quot" "a quotation ( elt -- ? )" } { "elt" "an element" } }
18 { $description "Gets the first sub-node of the object, in preorder, which satisfies the quotation. If nothing satisifies it, it returns " { $link f } "." } ;
19
20 HELP: deep-contains?
21 { $values { "obj" "an object" } { "quot" "a quotation ( elt -- ? )" } { "?" "a boolean" } }
22 { $description "Tests whether the given object or any subnode satisfies the given quotation." } ;
23
24 HELP: flatten
25 { $values { "obj" "an object" } { "seq" "a sequence" } }
26 { $description "Creates a sequence of all of the leaf nodes (non-sequence nodes, but including strings and numbers) in the object." } ;
27
28 HELP: deep-change-each
29 { $values { "obj" "an object" } { "quot" "a quotation ( elt -- newelt )" } }
30 { $description "Modifies each sub-node of an object in place, in preorder." } ;