On Thu, Apr 2, 2009 at 1:10 PM, Bradford Cross
<[email protected]> wrote:
> What is the current state of the art for language implementers working
> around these issues (tail calls, continuations, etc)  in Clojure, Scala,
> JRuby, etc?

Clojure uses recur (http://clojure.org/special_forms#toc10), "the only
non-stack-consuming looping construct in Clojure".

Here's the factory example from that page:

(def factorial
  (fn [n]
    (loop [cnt n acc 1]
       (if (zero? cnt)
            acc
          (recur (dec cnt) (* acc cnt))))))

Jim
-- 
Jim Menard, [email protected], [email protected]
http://www.io.com/~jimm/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to