4 ms·
Wow, this is basic stuff. I'm surprised that a researcher would get this wrong. Also, let us not forget that tail recursion is a specific form of the more gene
by elbenshira 16y ago
Wow, this is basic stuff. I'm surprised that a researcher would get this wrong.
Also, let us not forget that tail recursion is a specific form of the more general tail call optimization. For example, the following is two TCO-able functions calling each other:
functionA(...):
// do stuff
return functionB(...)
functionB():
// dostuff
return functionA(...)
Whether or not the compiler optimizes this, however, is a completely different question.