On Tue, Jul 09, 2013 at 08:11:58AM -0700, Alexander Gunnarson wrote: > Of course, tail-call recursion is not possible with JVM, so Clojure uses a * > recur* macro in place of direct recursive function calling. It avoids > blowing the stack as quickly but it's still not 100% "mathematically pure" > in the way Scheme tends to be.
I'm being a bit confrontational on purpose here, hoping that I might put together some discussion. If you don't like, skip to the next message now :). Clojure people say that jvm doesn't support tco, which it doesn't. So they implemented a recur macro that turns the function into an explicitly tcoable function. But, take a look at scala. It can do (naive) tco optimization without any extra effort from the developer. And on other lispy languages, check out sisc which is a scheme in jvm which too can do tco within jvm. Are clojure designers just lazy or is there a good reason for this .. lie? -- Mats Rauhala MasseR
signature.asc
Description: Digital signature