1.3.0 permalink Arrow_down_16x16

insert-left

clojure.zip

  • (insert-left loc item)
Inserts the item as the left 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:183 top

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

Comments top

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