Could you achieve this through a combination of clojure.zip/node and
get-in/assoc-in/update-in? Of course the missing piece is going back
from nodes to locs.

-- Nathan

On Dec 5, 2:54 pm, Randall R Schulz <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I looked at the Clojure implementation of Huet's Zipper and it looks
> great. I like how it delegates construction and dissection of the tree
> structure to client-supplied functions so that it is generic w.r.t. to
> any types (especially for me, pre-existing, non-Clojure Java types)
> that can be deemed to encode a tree structure.
>
> However, I would like to be able to examine the tree in the locality of
> the current traversal point through path or position specifications.
> This approach is commonly used in describing algorithms about logical
> formulas (which are inherently tree-structured). If you're not familiar
> with the notion, these paths / positions are directly analogous to file
> system path names, except that one uses integers to label the arcs,
> said integers being ordinals in the child sequence of a given node.
>
> It seems to me that being able to access local context using such paths
> during a tree traversal would be far more convenient in many cases to
> having to navigate locally to determine whether a particular structural
> pattern was present.
>
> As far as I can tell, there's no provision for this sort of local tree
> access in the current Zipper code. Is there any reason such a
> capability could not (or should not) be added to the existing Zipper??
>
> Randall Schulz
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to