Take the following data structure, wrapped up with clojure.zip/seq-
zip: '(+ (- 1 2) (* 3 4))

Repeatedly calling clojure.zip/next produces these "nodes":

+
(- 1 2)
-
1
2
...

The (- 1 2) is what's throwing me off. Drawing out a tree structure, I
see that my nodes are + - 1 2 * 3 4 and the structure (- 1 2) is a
group of nodes (arranged as a subtree), but shouldn't be a node
itself.

To continue what I actually want to accomplish: if I call next while
loc is currently on the +, I expect to see - as my node. If I then
call remove, I expect it to remove the whole sub-tree (- 1 2), since
minus is a parent of 1 and 2.

Am I just not understanding the node/tree paradigm the zipper
implementation uses?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to