Hi all, thank for the helpful discussion.
I've stumbled upon the same issue of needing to skip a subtree during a
traversal and solved it with the following skip function that is a slight
modification of one in the original message:
(defn skip-subtree
"Fast-forward a zipper to skip the subtree
On Tuesday, May 6, 2014 4:07:11 PM UTC+1, Alex Miller wrote:
>
> I wrote this article long ago which hints about this at the end:
> https://www.ibm.com/developerworks/library/j-treevisit/
>
I started from that actually, very helpful article.
I have since noticed a bug in my previous skip functio
I wrote this article long ago which hints about this at the end:
https://www.ibm.com/developerworks/library/j-treevisit/
The approach I have taken for editing trees with zippers is to do a
post-walk from end to beginning - that way you're always done transforming
and will not walk into your edit
Hi,
I'm using clojure.zip to edit a tree by visiting each location using
zip/next, possibly using zip/replace to alter the tree.
There are cases where I replace a part of the tree with another tree that
will/must not be visited, but I couldn't find a good way to skip nodes,
since
(zip/next (zip