Re: Why recur?

2010-01-19 Thread itsnotvalid
I kind of agree that loop acts as a point for recursion, however if the auo-TCO thing is possible, writing naturally recursing code would become possible. I think that recur could still exist independent like what other said. On Jan 18, 2:55 am, Richard Newman holyg...@gmail.com wrote: Other

Re: Why recur?

2010-01-18 Thread Alex Ott
Hello all I have a question to Rich - are there plans to introduce named loop/recur? In Scheme it very handy to create named let, and create nested loops. Currently in Clojure, I need to split nested loop into separate function, that not so often good -- With best wishes, Alex Ott, MBA

Re: Why recur?

2010-01-18 Thread Konrad Hinsen
On 18.01.2010, at 12:03, Alex Ott wrote: I have a question to Rich - are there plans to introduce named loop/recur? In Scheme it very handy to create named let, and create nested loops. Currently in Clojure, I need to split nested loop into separate function, that not so often good

Re: Why recur?

2010-01-18 Thread Martin Coxall
On 18 Jan 2010, at 11:23, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 18.01.2010, at 12:03, Alex Ott wrote: I have a question to Rich - are there plans to introduce named loop/recur? In Scheme it very handy to create named let, and create nested loops. Currently in Clojure, I

Re: Why recur?

2010-01-18 Thread Alex Ott
Re Konrad Hinsen at Mon, 18 Jan 2010 12:23:58 +0100 wrote: KH On 18.01.2010, at 12:03, Alex Ott wrote: I have a question to Rich - are there plans to introduce named loop/recur? In Scheme it very handy to create named let, and create nested loops. Currently in Clojure, I need to split

Re: Why recur?

2010-01-18 Thread Sean Devlin
I'm confused. Shouldn't the inner loop have the proper conditionals to break out of itself properly instead? On Jan 18, 8:48 am, Alex Ott alex...@gmail.com wrote: Re Konrad Hinsen  at Mon, 18 Jan 2010 12:23:58 +0100 wrote:  KH On 18.01.2010, at 12:03, Alex Ott wrote:   I have a question to

Re: Why recur?

2010-01-18 Thread Timothy Pratley
2010/1/18 Alex Ott alex...@gmail.com But this will not allow to jump to outer loop from inside of inner loop... If you require mutual recursion, letfn might be your answer See example here: http://groups.google.com/group/clojure/browse_thread/thread/a7aad1d5b94db748 -- You received this

Why recur?

2010-01-17 Thread itsnotvalid
Just started learning Clojure a day ago with Stuart's book I found that Clojure doesn't do tail recursion optimization, not at least for the most simplest form. Instead the call must be made to recur instead of the function itself. However in the more-or-less-the-same-camp Scala does such

Re: Why recur?

2010-01-17 Thread bOR_
Ugly is in the eye of the beholder :), but anyway, I got curious and dug up some info on scala's recursion: http://blog.richdougherty.com/2009/04/tail-calls-tailrec-and-trampolines.html On Jan 17, 7:39 am, itsnotvalid itsnotva...@gmail.com wrote: Just started learning Clojure a day ago with

Re: Why recur?

2010-01-17 Thread Gabi
I was wondering about that myself but was too embarrassed to ask :) On Jan 17, 8:39 am, itsnotvalid itsnotva...@gmail.com wrote: Just started learning Clojure a day ago with Stuart's book I found that Clojure doesn't do tail recursion optimization, not at least for the most simplest form.

Re: Why recur?

2010-01-17 Thread Richard Newman
Other people prefer having a form to explicitly request recursion. That way, you are able to say explicitly in your code: I expect this to be TCO-able, and have the compiler tell you if you are mistaken. Another advantage of the explicit form is that it can be used anonymously with `loop`

Re: Why recur?

2010-01-17 Thread Mark Engelberg
Even if Java and thus Clojure eventually adds TCO, I hope recur sticks around, because I have come to prefer loop-recur syntax for the kinds of things I do with named let in Scheme. TCO would certainly be useful, though. -- You received this message because you are subscribed to the Google