3 ms·
Your function in the tail recursion optimization exemple is actually not tail recursive. Factorial needs an accumulator parameter to get that tail call.
by aktiur 10y ago
Your function in the tail recursion optimization exemple is actually not tail recursive. Factorial needs an accumulator parameter to get that tail call.
- agumonkey 10y agoMaybe the decorator rewrites the AST. I've seen this before.
- santialbo 10y agoIt does, when the function is actually tco optimizable. The example is not. On the docs however it's correct http://coconut.readthedocs.io/en/master/DOCS.html#recursive http://coconut.readthedocs.io/en/master/DOCS.html#recursive
- coconutlang 10y agoGood catch! I'll fix it right away.