[nem-en] and and tail recursion
Kamil Skalski
kamil.skalski at gmail.com
Thu Jan 25 20:30:36 CET 2007
We are not very good at optimizing the 'def ... and ...' construct,
for example in your case the (empty!) closure of Main function is
created and both local functions are transformed into static methods.
We never inline anything if 'def .. and' apprears, so we also cannot
use direct jump here (like in any other tail recursive methods).
But if we speak about .NET's special .tail opcode, then yes, we emit
it here, but only if you add -Ot switch during compilation. We do not
use this switch by default, since MS.NET implementation is slower with
it compared to standard call. So this will only eliminate the possible
stack overflow.
2007/1/25, vc <vc at rsdn.ru>:
> If I write:
>
>
> def some(x)
> {
> csp(x)
> }
> and csp(x)
> {
> ...
> }
>
> whether does the compiler optimize tail call?
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list