rewrite-clj.zip.editz
edit
(edit zloc f & args)Apply the given function to the s-expression at the given location, using its result to replace the node there. (The result will be coerced to a node if possible.)
edit-node
(edit-node node f)Create s-expression from node, apply the function and create node from the result.
replace
(replace zloc value)Replace the node at the given location with one representing the given value. (The value will be coerced to a node if possible.)
splice
(splice zloc)Splice the given node, i.e. merge its children into the current one (akin to Clojure’s unquote-splicing macro: ~@...). - if the node is not one that can have children, no modification will be performed. - if the node has no or only whitespace children, it will be removed. - otherwise, splicing will be performed, moving the zipper to the first non-whitespace child afterwards.