in reply to Tail Recursion in Perl
Note that the functionality of stackless python's been in perl 5 since the very beginning -- perl 5 is already stackless in the 'stackless python' sense. The recursion limit is entirely arbitrary, and could be changed or removed if you want. It's only in there now under the assumption that when things get that recursive it's an error, which you could, if you wanted, change.
Re: Re: Tail Recursion in Perl
by stvn (Monsignor) on Dec 31, 2003 at 22:17 UTC
|
Interesting.
Pray tell, how could you change it? (The recursion limit that is)
And you say that perl is stackless in the 'stackless python' sense, so am I to assume that Perl's stack is not tied to the 'C' stack?
I suppose too that stackless python maybe wasnt the best example since its unlimited recursion does not mean 'efficient' recursion.
-stvn | [reply] |
|
Pray tell, how could you change it? (The recursion limit that is)
You don't change it - it's already infinite (well, up to the size of available virtual memory.) Of course, there's a warning you usually get when the recursion gets 100 deep, but that can be turned off with no warnings;
And you say that perl is stackless in the 'stackless python' sense, so am I to assume that Perl's stack is not tied to the 'C' stack?
Correct. There are a few things in Perl that can blow the C stack (such as certain pathological regexes), but mostly you're only limited by available memory.
Dave M
| [reply] |
|