Find limit of recursion: Difference between revisions

→‎{{header|Wren}}: Updated code to v0.4.0.
(Added XPL0 example.)
(→‎{{header|Wren}}: Updated code to v0.4.0.)
Line 3,343:
 
In Wren a fiber's stack starts small and is increased as required. It appears that the runtime makes no attempt to check for any limitation internally leaving the script to eventually segfault.
<syntaxhighlight lang="ecmascriptwren">var fF = Fn.new { |n|
f = Fn.new { |n|
if (n%500 == 0) System.print(n) // print progress after every 500 calls
fF.call(n + 1)
System.write("") // required to fix a VM recursion bug
f.call(n + 1)
}
fF.call(1)</syntaxhighlight>
 
{{out}}
9,476

edits