Tail Recursion
Functional programming languages commonly provide tail call optimization to allow for extensive use of recursion without stack overflow problems. Limitations in Java bytecode complicate tail call optimization on the JVM. In general, a function that calls itself with a tail call can be optimized, but mutually recursive functions cannot. Trampolines have been suggested as a workaround. Trampoline support has been provided by the Scala library with the object scala.util.control.TailCalls
since Scala 2.8.0 (released July 14, 2010).
Read more about this topic: Scala (programming Language), Features (with Reference To Java), Functional Tendencies
Famous quotes containing the word tail:
“In fact, now I come to think of it, do we decide questions, at all? We decide answers, no doubt: but surely the questions decide us? It is the dog, you know, that wags the tailnot the tail that wags the dog.”
—Lewis Carroll [Charles Lutwidge Dodgson] (18321898)