However even so I would argue against turning it on naively.
Oh I agree. It's not something that can be globally switched on for perl 5 (and the lousy speed for subroutine calls makes tail-recursive code less appealing anyway). I just don't think caller is a problem :-)
When the things destroyed are objects that may have side-effects in their DESTROY methods (see ReleaseAction for an example where this happens) then trying to optimize tail-recursion creates a significant change in what the code does.
True, but naive scope-related DESTROY code is going to be in trouble when we get proper GC in perl6 anyway :-)
In reply to Re^4: Iterative vs Recursive Processes
by adrianh
in thread Iterative vs Recursive Processes
by mvaline
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |