(use 'clojure.zip) (def vz (vector-zip [1 2 [73 88] 4])) (root (replace (-> vz down right right) 3)) =>[1 2 3 4]
Replaces the node at this loc with the value of (f node args)
(defn replace "Replaces the node at this loc, without moving" {:added "1.0"} [loc node] (let [[_ path] loc] (with-meta [node (assoc path :changed? true)] (meta loc))))
Comments top
No comments for replace. Log in to add a comment.