It is easy to do a lazy preorder walk of a tree (in psuedo-clojure):

(fn visit [node]
  (lazy-cons node (map visit (get-children node))))


So, that much is obvious.  However, I cannot think of an obvious way to do a
post-order traversal lazily.  I sort of assume it cannot be done, as the
whole point -- more or less -- of a post ordered walk is you've visited the
children already.

Am I correct?

Thanks.

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