A zipper keeps a focused location in a tree so you can navigate and edit nested data without mutating the original. In `clojure.zip`, a location is not the node itself: `zip/node` returns data, while movement functions return new locations. Call `zip/root` to obtain the tree with your changes; create a new zipper to navigate it again. section 8.4.4
Choose the operations that fit the job:
- Create a location with `zip/vector-zip`, `zip/seq-zip`, `zip/xml-zip`, or the generic `zip/zipper` for a custom tree. section 8.4.4
- Navigate with `zip/up`, `zip/down`, `zip/left`, and `zip/right`; a move with no available destination can return `nil`. section 8.4.4
- Edit with `zip/replace`, `zip/edit`, `zip/remove`, or insertion functions. Inserting a child at a leaf throws an exception. section 8.4.4
Edit one vector child
`(-> (zip/vector-zip [1 2 [3 4]]) zip/down zip/rightmost (zip/edit conj 5) zip/root)` returns `[1 2 [3 4 5]]`. section 8.4.4
Unlike `clojure.walk`, a zipper does not require a depth-first traversal: move only where needed, or use `zip/next` and `zip/prev` for depth-first movement. section 8.4.4
