Find limit of recursion: Difference between revisions

PascalABC.NET
No edit summary
(PascalABC.NET)
(One intermediate revision by one other user not shown)
Line 2,336:
=={{header|Pascal}}==
See [[Find_limit_of_recursion#Delphi | Delphi]]
 
=={{header|PascalABC.NET}}==
In .NET it's impossible to catch StackOverflowException
 
<syntaxhighlight lang="delphi">
procedure Recur(i: integer);
begin
System.Console.WriteLine(i);
Recur(i + 1);
end;
 
begin
Recur(0);
end.
</syntaxhighlight>
 
The Highest level of recursion I reached is 15909.
 
=={{header|Perl}}==
Line 2,994 ⟶ 3,011:
recurse(x+1)
</syntaxhighlight>
 
=={{header|RPL}}==
« 1 + <span style="color:blue">RECUR</span> » '<span style="color:blue">RECUR</span>' STO
 
0 <span style="color:blue">RECUR</span>
Each recursive call will increase the return stack size by 5 nibbles, which means that on a basic 32-kilobyte calculator, there's room for over 10,000 recursive calls of the above type. If the recursion algorithm needs to pass arguments through the data stack or use local variables, the number of recursions will be much lower.
 
=={{header|Ruby}}==
222

edits