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

insert-right

clojure.zip

  • (insert-right loc item)
Inserts the item as the right sibling of the node at this loc,
without moving

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/zip.clj:193 top

(defn insert-right
  "Inserts the item as the right sibling of the node at this loc,
  without moving"
  {:added "1.0"}
  [loc item]
    (let [[node {r :r :as path}] loc]
      (if (nil? path)
        (throw (new Exception "Insert at top"))
        (with-meta [node (assoc path :r (cons item r) :changed? true)] (meta loc)))))
Vars in clojure.zip/insert-right: defn let meta nil? with-meta
Used in 0 other vars

Comments top

No comments for insert-right. Log in to add a comment.