Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by
retagged by

Inserting at top can throw an exception.

(require '[clojure.zip :as z])
(-> (z/vector-zip [])
    (z/insert-right :foo)
    z/root)
;; Execution error: Insert at top

However, making any edit will cause inserts to be silently ignored.

(-> (z/vector-zip [])
    (z/replace [])
    (z/insert-right :foo)
    z/root) 
;; []

Not a big deal, but I missed a bug that would have been otherwise caught.

1 Answer

0 votes
by
selected by
...