Re: clojure.zip: skip a node

2018-03-06 Thread Marco Rucci
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

Re: clojure.zip: skip a node

2014-05-06 Thread Pascal Germroth
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

Re: clojure.zip: skip a node

2014-05-06 Thread Alex Miller
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

clojure.zip: skip a node

2014-05-05 Thread Pascal Germroth
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