Find limit of recursion: Difference between revisions
Content added Content deleted
(Added XPL0 example.) |
(→{{header|Wren}}: Updated code to v0.4.0.) |
||
Line 3,343: | 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. |
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=" |
<syntaxhighlight lang="wren">var F = Fn.new { |n| |
||
f = Fn.new { |n| |
|||
if (n%500 == 0) System.print(n) // print progress after every 500 calls |
if (n%500 == 0) System.print(n) // print progress after every 500 calls |
||
⚫ | |||
System.write("") // required to fix a VM recursion bug |
|||
⚫ | |||
} |
} |
||
F.call(1)</syntaxhighlight> |
|||
{{out}} |
{{out}} |