Liking cljdoc? Tell your friends :D

squirrel.tree


*identity*clj

Identity element for the squirrel.tree/add binary operation.

Identity element for the squirrel.tree/add binary operation.
sourceraw docstring

addclj

(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.
sourceraw docstring

filterclj

(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*.
sourceraw docstring

mapclj

(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*.
sourceraw docstring

reduceclj

(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.
sourceraw docstring

removeclj

(remove pred tree)

Shorthand for (squirrel.tree/filter (complement pred) tree)

Shorthand for (squirrel.tree/filter (complement pred) tree)
sourceraw docstring

seqclj

(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.
sourceraw docstring

seq-innercljmultimethod

Don't call this directly, use squirrel.tree/seq instead.

Don't call this directly, use squirrel.tree/seq instead.
sourceraw docstring

sweepclj

(sweep tree)

Sweeps all nodes in tree. See squirrel.node/sweep for details.

Sweeps all nodes in tree. See squirrel.node/sweep for details.
sourceraw docstring

weighty?clj

(weighty? tree)

True if tree is neither nil nor identity, false otherwise.

True if tree is neither nil nor *identity*, false otherwise.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close