function | since v0.0-927 | ![]() | Edit |
(leftmost loc)
Returns the loc of the leftmost sibling of the node at this loc, or self
(defn leftmost
[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)))