Identity element for the squirrel.tree/add binary operation.
Identity element for the squirrel.tree/add binary operation.
(add)
(add x)
(add x y)
(add x y & ys)
Makes tree y the last descendant of tree x. If x has no children, y becomes the first child of x. Is associative with identity as identity element. Variadic version is shorthand for reducing over the arguments.
Makes tree y the last descendant of tree x. If x has no children, y becomes the first child of x. Is associative with *identity* as identity element. Variadic version is shorthand for reducing over the arguments.
(filter pred tree)
Tree consisting of those nodes for which (pred node) returns logical true. Function pred must be free of side-effects. If run on nil or identity, returns identity.
Tree consisting of those nodes for which (pred node) returns logical true. Function pred must be free of side-effects. If run on nil or *identity*, returns *identity*.
(map f tree)
(map pref postf tree)
Tree consisting of the result of applying f to each node in tree. Nodes are walked in depth-first order. Applies f and pref before walking child nodes, postf after. If run on nil or identity, returns identity.
Tree consisting of the result of applying f to each node in tree. Nodes are walked in depth-first order. Applies f and pref before walking child nodes, postf after. If run on nil or *identity*, returns *identity*.
(reduce f tree traversal)
(reduce f init tree traversal)
Reduces tree to a value by applying f to the data of each node in tree. Has the same signature as clojure.core/reduce, with the addition of traversal, which must be either :depth-first or :breadth-first.
Reduces tree to a value by applying f to the data of each node in tree. Has the same signature as clojure.core/reduce, with the addition of traversal, which must be either :depth-first or :breadth-first.
(remove pred tree)
Shorthand for (squirrel.tree/filter (complement pred) tree)
Shorthand for (squirrel.tree/filter (complement pred) tree)
(seq tree)
(seq tree options)
Sequence representation of tree. If tree is identity or nil, returns nil. The :traversal key in the options hash may be either :depth-first or :breadth-first, the former being the default.
Sequence representation of tree. If tree is *identity* or nil, returns nil. The :traversal key in the options hash may be either :depth-first or :breadth-first, the former being the default.
Don't call this directly, use squirrel.tree/seq instead.
Don't call this directly, use squirrel.tree/seq instead.
(sweep tree)
Sweeps all nodes in tree. See squirrel.node/sweep for details.
Sweeps all nodes in tree. See squirrel.node/sweep for details.
(weighty? tree)
True if tree is neither nil nor identity, false otherwise.
True if tree is neither nil nor *identity*, false otherwise.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close