function | since v0.0-927 | ![]() | Edit |
(root loc)
zips all the way up and returns the root node, reflecting any changes.
(defn root
[loc]
(if (= :end (loc 1))
(node loc)
(let [p (up loc)]
(if p
(recur p)
(node loc)))))