You appear to have misunderstood. I didn't say that eliminating recursion was bad, I said that using goto &{...} nearly always is. There are probably better ways to do this in perl but one of the "best" ways I know of is to just go back to the top of the routine after setting @_ with the new args. For short routines and such.
sub foo { { ... # Recurse but without actually calling foo() again. @_ = ...; redo; } }
I also expect that there are better ways to save on memory than eliminating stack frames.
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In reply to Re^3: Tail recursion elimination
by diotalevi
in thread Tail recursion elimination
by billh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |