Created
February 23, 2013 08:39
-
-
Save shark8me/5018984 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;this returns the value of :self nodes from the root to the leaf | |
| (defn gpath [n] | |
| "returns that path from the parent till the leaf" | |
| (conj (vec (map :self (zip/path n))) (-> n zip/node :self))) | |
| ;path from root to leaf. | |
| (is (= '([20 10 11] [20 10 12] [20 30 31] [20 30 32]) | |
| (map (comp gpath) (leafnodes (mzipper mroot))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment