ClojureDocs

Nav

Namespaces

path

clojure.zip

Available since 1.0
  • (path loc)
Returns a seq of nodes leading to this loc
1 Example

(def nested-vecs
  [:foo [:bar :baz [:bork]]])

;; now let's make a zipper
(def z (zip/vector-zip nested-vecs))

;; "path" only returns the "down nodes" necessary to reach the destination.
;; Any other horizontal movement is not collected:

(-> z
    zip/down ;; down1 [:foo [:bar :baz [:bork]]]
    zip/right
    zip/down ;; down2 [:bar :baz [:bork]]
    zip/rightmost
    zip/down ;; down3 [:bork]
    zip/path)

;; [[:foo [:bar :baz [:bork]]] 
;;  [:bar :baz [:bork]] 
;;  [:bork]]



See Also
No see-alsos for clojure.zip/path
0 Notes
No notes for path