Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # zip-next - https://clojuredocs.org/clojure.zip/next <code clojure> ;; zip-walk takes a transformation function f and a zipper z. ;; f takes a location and returns location. Applies f ;; to the nodes in the zipper maintaining the original nesting. (require '[clojure.zip :as zip]) (defn zip-walk [f z] (if (zip/end? z) (zip/root z) (recur f (zip/next (f z))))) (zip-walk (fn [loc] (if (zip/branch? loc) loc (zip/edit loc * 2))) (zip/vector-zip [1 2 [3 4]])) ;; [2 4 [6 8]] </code> open/zip-next.txt Last modified: 2024/10/05 06:15by 127.0.0.1