1.3.0 permalink Arrow_down_16x16
  • (prev loc)
Moves to the previous loc in the hierarchy, depth-first. If already
at the root, returns nil.

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:246 top

(defn prev
  "Moves to the previous loc in the hierarchy, depth-first. If already
  at the root, returns nil."
  {:added "1.0"}
  [loc]
    (if-let [lloc (left loc)]
      (loop [loc lloc]
        (if-let [child (and (branch? loc) (down loc))]
          (recur (rightmost child))
          loc))
      (up loc)))
Vars in clojure.zip/prev:
Used in 0 other vars

Comments top

No comments for prev. Log in to add a comment.