You're viewing version 1.2.0 of leftmost. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

leftmost

clojure.zip

  • (leftmost loc)
Returns the loc of the leftmost sibling of the node at this loc, or self

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

(defn leftmost
  "Returns the loc of the leftmost sibling of the node at this loc, or self"
  {:added "1.0"}
  [loc]
    (let [[node {l :l r :r :as path}] loc]
      (if (and path (seq l))
        (with-meta [(first l) (assoc path :l [] :r (concat (rest l) [node] r))] (meta loc))
        loc)))
Vars in clojure.zip/leftmost: and defn let meta seq with-meta
Used in 0 other vars

Comments top

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