Scala (programming Language) - Features (with Reference To Java) - Functional Tendencies - Tail Recursion

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:

    The tiger in the tiger-pit
    Is not more irritable than I.
    The whipping tail is not more still
    Than when I smell the enemy
    Writhing in the essential blood
    Or dangling from the friendly tree.
    —T.S. (Thomas Stearns)