On Sun, Jun 13, 2010 at 7:35 PM, Oleg <oleg.richa...@gmail.com> wrote:
>
> Currently i'm just calling function, but there is a danger of
> StackOverflow. I can't use recur, because it's not last statement. As
> i can understand recur is good to build long sequences, but in my case
> i'm building hierarchy.

Two potential solutions:
1. Build a lazy hierarchy, i.e. instead of returning a nested
structure, return a function that produces it. It might be better to
use a built-in function tree-seq though (check the implementation of
file-seq and xml-seq).
2. If everything else fails use a trampoline
http://groups.google.com/group/clojure/browse_frm/thread/6257cbc4454bcb85/7d5fd827cd549080#7d5fd827cd549080

Cheers,

Andrzej

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