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:
“Dizzily down the abyss he wheels
So fell Darius. Upon his crown,
In the midst of the barn-yard he came down,
In a wonderful whirl of tangled strings,
Broken braces and broken springs,
Broken tail and broken wings,”
—John Townsend Trowbridge (18271916)