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.
raw 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.
raw 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*.
raw docstring

mapclj

(map f tree)

Tree consisting of the result of applying f to each node in tree. Nodes are walked in breadth-first order. Any modifications f makes to the collection of child nodes and/or to the child nodes themselves will be observable in later calls. 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 breadth-first order. Any modifications f makes to the collection of
child nodes and/or to the child nodes themselves will be observable in later
calls. If run on nil or *identity*, returns *identity*.
raw 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.
raw docstring

removeclj

(remove pred tree)

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

Shorthand for (squirrel.tree/filter (complement pred) tree)
raw 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.
raw docstring

seq-innercljmultimethod

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

Don't call this directly, use squirrel.tree/seq instead.
raw 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.
raw docstring

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

× close