Geoff Canyon <gcanyon@...> writes:

> 
> So I was curious whether LC optimizes tail calls. It appears not. But even
> stranger, this code busts the recursion limits. It should only call itself
> 900 times, right?

> And am I correct that if LC optimized tail calls, then this would work
> regardless of the recursionLimit.

Yes, that should be a valid candidate for optimization.

It's a little surprising that this breaks the default recursionLimit. I
found that it breaks on the 655th iteration. So 654 iterations in 400k
leaves a bit over 600 bytes per stack frame, which seems a little excessive
for this simple function call.

-- 
 Mark Wieder
 [email protected]



_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to