From: Ken A. <kan...@bb...> - 2004-11-23 19:03:16
|
Here's an interesting paper on how to do tail calls in Java. http://docs.msdnaa.net/ark_new/Webfiles/WhitePapers/Babel01/bab12.pdf They do a CPS conversion and rather than doing tail calls they pass in a stack depth counter with each call, when the counter goes to 0 they either throw or return a continuation. When the original call recieves the continuation it just executes it again to keep the computation going. |