zipup.core

copy-zip

(copy-zip loc move-fn & {:keys [replace?]})

Copies the node at loc to the location specified by move-fn, appending the copy as a child of the destination node. If replace? is truthy, replaces the destination node instead.

cut-zip

(cut-zip loc & move-fns)

Removes nodes visited by applying move-fns to loc

down-nth

Applies clojure.zip/down to loc n times. See move-nth.

leaf?

Returns true if the node at loc is a leaf node

left-nth

Applies clojure.zip/left to loc n times. See move-nth.

map-zip

(map-zip f pred loc)

Applies f to every node in the tree rooted at loc for which (pred loc) returns true

move-nth

(move-nth move-fn loc n)

Applies move-fn to loc n times

next-nth

Applies clojure.zip/next to loc n times. See move-nth.

prev-nth

Applies clojure.zip/prev to loc n times. See move-nth.

right-nth

Applies clojure.zip/right to loc n times. See move-nth.

root-loc

(root-loc loc)

Like clojure.zip/root, but returns the loc of the root node

top?

(top? loc)

Returns true if the node at loc is the root node

up-nth

Applies clojure.zip/up to loc n times. See move-nth.