Hello Guys!

Here is the task:

Assume that we have function called `fetch-from-source`, which used to
fetch vector of maps from the data source. I want to make iteration on
every fetched row (element of vector) and ask `fetch-from-source`
again to add 'children' key to that row. And so on, until given
depth.

So i want to use map function on collection from some function `expand-
groups`, which will call the same function `expand-groups` on every
collection element to assign children on it. Keep in mind, that the
map function is not last in my function, because i have to append one
more row to mapped collection.

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.


What do you think guys? Is there are clojure-rish way to solve that
problem?

Cheers, Oleg

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