in reply to Re: Recursion Alternatives?
in thread Recursion Alternatives?

You can "optimise" out the stack frame in tail recursive code in perl5 using goto. E.g.:

sub fact { my($n, $a) = @_; return $a unless $n > 1; @_ = ($n-1, $n*$a); goto &fact; }

However, this is so wildly slow it's rarely worth the effort :-)

If perl6 doesn't manage to do tail-recursion optimisation I hope we at least get an efficient way to throw away a call-stack level so we can code it by hand.