Find limit of recursion: Difference between revisions

(added Inform 7 solution)
Line 586:
 
<lang Retro>: try -6 5 out wait 5 in putn cr try ;</lang>
 
=={{header|REXX}}==
<lang rexx>
/*REXX program test limits of recursion.*/
 
n=0
call self
exit
 
 
self: procedure expose n
n=n+1
say n
call self
exit
The last portion of the output when using Regina 3.5
under Windows/XP Pro:
<pre style="height:30ex;overflow:scroll">
164134
164135
164136
164137
164138
164139
164140
164141
System resources exhausted
</pre>
The last portion of the output when using Personal/REXX
under Windows/XP Pro.
<br>
I couldn't capture the recursion level, but the last number
shown was 240.
<pre style="height:30ex;overflow:scroll">
12 +++ call self
12 +++ call self
12 +++ call self
12 +++ call self
12 +++ call self
12 +++ call self
12 +++ call self
12 +++ call self
12 +++ call self
4 +++ call self
Error 5 on line 12 of D:\SELF.REX: Machine resources exhausted
 
</pre>
The last portion of the output when using R4 REXX
under Windows/XP Pro:
<pre style="height:30ex;overflow:scroll">
499
500
501
502
503
504
505
506
An unexpected error occurred
</pre>
 
=={{header|Ruby}}==