(add-at-path tree dir-path element)
dir-path : '( '/' <elem str> <elem str> ....) returns nil if not possible to add, meaning intermediate path elem missing returns a new tree if addition was made returns the original tree if the path already exists
dir-path : '( '/' <elem str> <elem str> ....) returns nil if not possible to add, meaning intermediate path elem missing returns a new tree if addition was made returns the original tree if the path already exists
(find-path tree path)
path is a list of the form '('/' 'tmp' 'sub'), would find '/tmp/sub'
path is a list of the form '('/' 'tmp' 'sub'), would find '/tmp/sub'
(path-up tree)
Returns a list, reverse of which can be used to find the current node from root
Returns a list, reverse of which can be used to find the current node from root
(remove-path tree path)
returns nil if unable to remove (can't remove root, path does not exists) returns new tree if removal worked
returns nil if unable to remove (can't remove root, path does not exists) returns new tree if removal worked
(tree-zip root)
Make a zipper out of a tree.
Make a zipper out of a tree.
(branch? node)
Is it possible for node to have children?
Is it possible for node to have children?
(make-node node children)
Makes new node from existing node and children.
Makes new node from existing node and children.
(node-children node)
Return children of this node.
Return children of this node.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close