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:
“His friends he loved. His direst earthly foes
CatsI believe he did but feign to hate.
My hand will miss the insinuated nose,
Mine eyes the tail that waggd contempt at Fate.”
—Sir William Watson (18581935)