function | since v0.0-927 | ![]() | Edit |
(rightmost loc)
Returns the loc of the rightmost sibling of the node at this loc, or self
(defn rightmost
[loc]
(let [[node {l :l r :r :as path}] loc]
(if (and path r)
(with-meta [(last r) (assoc path :l (apply conj l node (butlast r)) :r nil)] (meta loc))
loc)))