FWIW there's a lot of prior threads about this problem in various guises. The one I like to refer people to is on stackoverflow, and is for exactly what you're doing: http://stackoverflow.com/questions/2946764/recursive-function-causing-a-stack-overflow
On Sep 22, 9:36 am, Alf Kristian Støyle <[email protected]> wrote: > Jup, that solved the problem. Lesson learned. > > Thanks :) > Alf > > On Thu, Sep 22, 2011 at 17:54, Meikel Brandmeyer (kotarak) <[email protected]> > wrote: > > > > > > > > > Hi, > > > Am Donnerstag, 22. September 2011 17:43:30 UTC+2 schrieb Alf: > > >> What am I doing wrong here, will filter/remove or something else give > >> StackOverflowError when used incorrectly? > > > Yes. You pile lazy seq on lazy seq on lazy seq on .... and then realise the > > first element. This kicks off a cascade which finally causes the stack > > overflow when your lazy seq pile is large enough. > > > Put a doall around the remove. This will realise the seq immediatelly and > > the cascade cannot happen. So it should solve the issue. > > > Sincerely > > Meikel > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to [email protected] > > Note that posts from new members are moderated - please be patient with your > > first post. > > 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 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. 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
