Find limit of recursion: Difference between revisions

Content added Content deleted
(→‎{{header|Applescript}}: Added a basic Applescript version)
Line 95: Line 95:
pcl@anubis ~/a68/Rosetta $
pcl@anubis ~/a68/Rosetta $
</pre>
</pre>

=={{header|AppleScript}}==
A basic test for Applescript, which has a notoriously shallow recursion stack.
<lang applescript>-- recursionDepth :: () -> IO String
on recursionDepth()
script go
on |λ|(i)
try
|λ|(1 + i)
on error
"Recursion limit encountered at " & i
end try
end |λ|
end script
go's |λ|(0)
end recursionDepth

on run
recursionDepth()
end run</lang>
{{Out}}
<pre>"Recursion limit encountered at 502"</pre>


=={{header|AutoHotkey}}==
=={{header|AutoHotkey}}==