Liking cljdoc? Tell your friends :D

clojure.zip

Functional hierarchical zipper, with navigation, editing, and enumeration. See Huet

Functional hierarchical zipper, with navigation, editing,
and enumeration.  See Huet
raw docstring

append-childclj

(append-child loc item)

Inserts the item as the rightmost child of the node at this loc, without moving

Inserts the item as the rightmost child of the node at this loc,
without moving
sourceraw docstring

branch?clj

(branch? loc)

Returns true if the node at loc is a branch

Returns true if the node at loc is a branch
sourceraw docstring

childrenclj

(children loc)

Returns a seq of the children of node at loc, which must be a branch

Returns a seq of the children of node at loc, which must be a branch
sourceraw docstring

downclj

(down loc)

Returns the loc of the leftmost child of the node at this loc, or nil if no children

Returns the loc of the leftmost child of the node at this loc, or
nil if no children
sourceraw docstring

editclj

(edit loc f & args)

Replaces the node at this loc with the value of (f node args)

Replaces the node at this loc with the value of (f node args)
sourceraw docstring

end?clj

(end? loc)

Returns true if loc represents the end of a depth-first walk

Returns true if loc represents the end of a depth-first walk
sourceraw docstring

insert-childclj

(insert-child loc item)

Inserts the item as the leftmost child of the node at this loc, without moving

Inserts the item as the leftmost child of the node at this loc,
without moving
sourceraw docstring

insert-leftclj

(insert-left loc item)

Inserts the item as the left sibling of the node at this loc, without moving

Inserts the item as the left sibling of the node at this loc,
without moving
sourceraw docstring

insert-rightclj

(insert-right loc item)

Inserts the item as the right sibling of the node at this loc, without moving

Inserts the item as the right sibling of the node at this loc,
without moving
sourceraw docstring

leftclj

(left loc)

Returns the loc of the left sibling of the node at this loc, or nil

Returns the loc of the left sibling of the node at this loc, or nil
sourceraw docstring

leftmostclj

(leftmost loc)

Returns the loc of the leftmost sibling of the node at this loc, or self

Returns the loc of the leftmost sibling of the node at this loc, or self
sourceraw docstring

leftsclj

(lefts loc)

Returns a seq of the left siblings of this loc

Returns a seq of the left siblings of this loc
sourceraw docstring

make-nodeclj

(make-node loc node children)

Returns a new branch node, given an existing node and new children. The loc is only used to supply the constructor.

Returns a new branch node, given an existing node and new
children. The loc is only used to supply the constructor.
sourceraw docstring

nextclj

(next loc)

Moves to the next loc in the hierarchy, depth-first. When reaching the end, returns a distinguished loc detectable via end?. If already at the end, stays there.

Moves to the next loc in the hierarchy, depth-first. When reaching
the end, returns a distinguished loc detectable via end?. If already
at the end, stays there.
sourceraw docstring

nodeclj

(node loc)

Returns the node at loc

Returns the node at loc
sourceraw docstring

pathclj

(path loc)

Returns a seq of nodes leading to this loc

Returns a seq of nodes leading to this loc
sourceraw docstring

prevclj

(prev loc)

Moves to the previous loc in the hierarchy, depth-first. If already at the root, returns nil.

Moves to the previous loc in the hierarchy, depth-first. If already
at the root, returns nil.
sourceraw docstring

removeclj

(remove loc)

Removes the node at loc, returning the loc that would have preceded it in a depth-first walk.

Removes the node at loc, returning the loc that would have preceded
it in a depth-first walk.
sourceraw docstring

replaceclj

(replace loc node)

Replaces the node at this loc, without moving

Replaces the node at this loc, without moving
sourceraw docstring

(right loc)

Returns the loc of the right sibling of the node at this loc, or nil

Returns the loc of the right sibling of the node at this loc, or nil
sourceraw docstring

rightmostclj

(rightmost loc)

Returns the loc of the rightmost sibling of the node at this loc, or self

Returns the loc of the rightmost sibling of the node at this loc, or self
sourceraw docstring

rightsclj

(rights loc)

Returns a seq of the right siblings of this loc

Returns a seq of the right siblings of this loc
sourceraw docstring

rootclj

(root loc)

zips all the way up and returns the root node, reflecting any changes.

zips all the way up and returns the root node, reflecting any
changes.
sourceraw docstring

seq-zipclj

(seq-zip root)

Returns a zipper for nested sequences, given a root sequence

Returns a zipper for nested sequences, given a root sequence
sourceraw docstring

upclj

(up loc)

Returns the loc of the parent of the node at this loc, or nil if at the top

Returns the loc of the parent of the node at this loc, or nil if at
the top
sourceraw docstring

vector-zipclj

(vector-zip root)

Returns a zipper for nested vectors, given a root vector

Returns a zipper for nested vectors, given a root vector
sourceraw docstring

xml-zipclj

(xml-zip root)

Returns a zipper for xml elements (as from xml/parse), given a root element

Returns a zipper for xml elements (as from xml/parse),
given a root element
sourceraw docstring

zipperclj

(zipper branch? children make-node root)

Creates a new zipper structure.

branch? is a fn that, given a node, returns true if can have children, even if it currently doesn't.

children is a fn that, given a branch node, returns a seq of its children.

make-node is a fn that, given an existing node and a seq of children, returns a new branch node with the supplied children. root is the root node.

Creates a new zipper structure. 

branch? is a fn that, given a node, returns true if can have
children, even if it currently doesn't.

children is a fn that, given a branch node, returns a seq of its
children.

make-node is a fn that, given an existing node and a seq of
children, returns a new branch node with the supplied children.
root is the root node.
sourceraw docstring

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

× close