1 USING: help.syntax help.markup kernel sequences ;
5 { $values { "obj" object } { "quot" { $quotation "( elt -- )" } } }
6 { $description "Execute a quotation on each nested element of an object and its children, in preorder." }
10 { $values { "obj" object } { "quot" { $quotation "( elt -- newelt )" } } { "newobj" "the mapped object" } }
11 { $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." }
15 { $values { "obj" object } { "quot" { $quotation "( elt -- ? )" } } { "seq" "a sequence" } }
16 { $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." }
17 { $see-also filter } ;
20 { $values { "obj" object } { "quot" { $quotation "( elt -- ? )" } } { "elt" "an element" } }
21 { $description "Gets the first sub-node of the object, in preorder, which satisfies the quotation. If nothing satisifies it, it returns " { $link f } "." }
25 { $values { "obj" object } { "quot" { $quotation "( elt -- ? )" } } { "?" "a boolean" } }
26 { $description "Tests whether the given object or any subnode satisfies the given quotation." }
30 { $values { "obj" object } { "seq" "a sequence" } }
31 { $description "Creates a sequence of all of the leaf nodes (non-sequence nodes, but including strings and numbers) in the object." } ;
33 HELP: deep-change-each
34 { $values { "obj" object } { "quot" { $quotation "( elt -- newelt )" } } }
35 { $description "Modifies each sub-node of an object in place, in preorder." }
36 { $see-also change-each } ;
38 ARTICLE: "sequences.deep" "Deep sequence combinators"
39 "The combinators in the " { $vocab-link "sequences.deep" } " vocabulary are variants of standard sequence combinators which traverse nested subsequences."
40 { $subsection deep-each }
41 { $subsection deep-map }
42 { $subsection deep-filter }
43 { $subsection deep-find }
44 { $subsection deep-any? }
45 { $subsection deep-change-each }
46 "A utility word to collapse nested subsequences:"
47 { $subsection flatten } ;
49 ABOUT: "sequences.deep"