Sounds like zippers may be able to help you here. When you use a zipper to
descend into a tree, it automatically generates a trail of breadcrumbs to
enable you to ascend back to the top, without needing backreferences in the
original data structure. And it's purely functional, too.

Phil
On Jul 7, 2012 12:56 AM, "Warren Lynn" <wrn.l...@gmail.com> wrote:

> Hi, Phil:
>
> Thanks for your detailed analysis.
>
> My use-case is I have a tree and want to walk over the tree and apply a
> function on the nodes. The operation of the function also depends on the
> parent and children of the node, so it will be nice if each node already
> contains the references to its parent and children. Something like that.
>
> I guess I will just use atoms to hold the reference. I am not in pursuit
> of pure functional programming, so if it is too much trouble to do it with
> FP, I will take whatever works.
>
>
>
>
>  --
> 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

-- 
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

Reply via email to