Robert Fischer wrote: > Chas Emerick wrote: > >>In those rare circumstances where you need to write mutually-recursive >>functions without consuming stack, clojure provides a trampoline >>implementation (introduced last November here: >>http://groups.google.com/group/clojure/browse_frm/thread/6257cbc4454bcb85) >>. There's obviously a performance penalty associated with their use, >>but it's nice to have that escape hatch. >> > > I was thinking about this. For any given tail recursive function, it can be > turned into a > non-stack-building loop. The transformation I'm thinking of looks like this: > ...
That is what Kawa does (as a code generation option) in order to fully support tail-calls, as Per explained earlier today (10:11AM). There is a paper or two and a couple presentations on that which Per didn't cite. http://www.google.com/search?q=tail+call+support+in+kawa Jim --- http://www.ifcx.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com To unsubscribe from this group, send email to jvm-languages+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---