On Thu, Oct 16, 2008 at 2:10 PM, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote: > > So I need some external way of navigation. Maybe one can also > provide a function how to compare nodes. ad-hoc trees like > [1 [2 3] [[[4 5] 6] 7 8]] then only have identical? as a predicate, > which does not compare the whole tree. But for example a tree > representing some files doesn't need the whole node, but only a > label. /usr/bin/clojure. Three labels: "usr", "bin" and "clojure". > Together with the way they are composed they identify the node.
Ok, we're on the same page here. I think the only problem with your original example was that since a node contains all of its descendants, = isn't a terribly useful way to navigate. As you suggest, you want some kind of selector to pick out the bits you actually want to use in navigation, "filename" or whatever. Perhaps you could simply pass in a filter function to your original goto, to allow partial application-specific comparisons. I've already done some work for navigation of zip-xml trees -- see clojure.contrib.zip-filter.xml I'm not sure how zip-seq trees would be used and if there's anything from clojure.contrib.zip-filter that would be useful for navigating those. --Chouser --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---