You're viewing version 1.2.0 of replace. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

replace

clojure.zip

  • (replace loc node)
Replaces the node at this loc, without moving

1 Example top

  • (use 'clojure.zip)
    
    (def vz (vector-zip [1 2 [73 88] 4]))
    
    (root (replace (-> vz down right right) 3))
    =>[1 2 3 4]
Log in to add / edit an example.

See Also top

  • 0
    clojure.zip/edit

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

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/zip.clj:203 top

(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))))
Vars in clojure.zip/replace: defn let meta replace with-meta
Used in 0 other vars

Comments top

No comments for replace. Log in to add a comment.