Hello [EMAIL PROTECTED]!

On 28-Nov-99, you wrote:

[...]
 o> fac1 and fac2 are semantically identical. But how would you
 o> dynamically see that you should eliminate tail recursion in
 o> fac2? Sure, you could do it by looking forward some bytes
 o> (seeing that there isn't anything more to do in the body of
 o> the function), but if you should do this properly, program
 o> execution will probably be slowed down.

REBOL 1.0 was tail recursive, and it was SLOW. This is because, as
Joe Marshall expalined to me, handling tail recursion is not an
easy thing to do. I'd like to see tail recursion back in REBOL,
but I'm not sure if I'd want the complexity of the interpreter to
increase. I'd prefer a better solution, such as testing for tail
recursion only on function that require it:

f: tail-recursive-func [...] [...]

Regards,
    Gabriele.
-- 
o--------------------) .-^-. (----------------------------------o
| Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila |
| GIESSE on IRC     \ \-\_/-/ /  http://www.amyresource.it/AGI/ |
o--------------------) `-v-' (----------------------------------o

Reply via email to