2 ms·
> Sometimes it’s hard to know if a language that automatically compiles to tail recursion will even always do it. I wish more languages that do not always comp
by JD557 7y ago
> Sometimes it’s hard to know if a language that automatically compiles to tail recursion will even always do it.
I wish more languages that do not always compile to tail recursive methods had something similar to Scala's `@tailrec` annotation (which forces the compilation to fail if the tail calls cannot be optimized).
It's not a very elegant solution, but at least it works.