Hi, On Jul 20, 10:35 am, kyle smith <the1physic...@gmail.com> wrote: > I'm trying to learn how to use zippers, and I have some thoughts: Why > does (root loc) return a node, rather than just the location of the > root? If the latter were true and you wanted the node, you could just > call (node (root loc)). As it is, once you call (root loc), you lose > the reference to the zipper structure.
At the moment "root" works like an "unzip". What you want it is some kind of "up-till-root" shortcut. If "root" changes its meaning, something like "unzip" should be added. (unzip loc) could just be a shortcut for (node (root loc)). I think unzip makes it clear, that we now leave the zipper session, which (node (root loc)) does not. > It would also be nice if the docs mentioned that a loc is a vector of > [node path]. Why do you need to know? > The doc for zipper should also say something like > "Creates a new zipper structure. Returns the loc of the root node. ..." That would be more consistent of with the rest of the documentation. Sincerely Meikel --~--~---------~--~----~------------~-------~--~----~ 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 Note that posts from new members are moderated - please be patient with your first post. 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 -~----------~----~----~----~------~----~------~--~---