For those who are not familiar with the term, proper tail recursion means that if the last operation of a function is a call to itself only with different argument, than the function simply goes to its beginning.
Proper Tail Recursion is harder to debug, but consumes less memory and is faster to execute, when illustrating iterative processes. The Scheme standards precisely specify that a Scheme implementation must have proper tail recursion. Since we intend Parrot to serve as the backend for a Scheme interpreter, we should take proper tail recursion into consideration. Nonetheless, such an option would prove useful to coders in other languages too, because it will mean that they will be less reluctant to use recursion in their algorithms. Now the question is: at what level do we implement it? We can place all the burden on the front-end. Then again, we can provide with some well-defined mechanisms and/or optimizations in Parrot to do so. For instance, we can have a "ret-with-call" opcode. However, isn't it exactly the same as a jump instruction ? What is the current stance on implementing proper tail recursion in perl6? Regards, Shlomi Fish ---------------------------------------------------------------------- Shlomi Fish [EMAIL PROTECTED] Home Page: http://t2.technion.ac.il/~shlomif/ Home E-mail: [EMAIL PROTECTED] If: 1. A is A 2. A is not not-A does it imply that 1. B is B 2. B is not not-B