Learn the concept of tail recursion and how to get the most out of it in Kotlin.
I'm wondering if the compiler could detect a tail recursion and enable tailrec automatically. If so, why is it a keyword and not something that's done by default whenever possible. Would there be any drawback in doing this?
I'm wondering if the compiler could detect a tail recursion and enable tailrec automatically. If so, why is it a keyword and not something that's done by default whenever possible. Would there be any drawback in doing this?