Tail call

Tail call

A tail call is a subroutine call just before the end of a subroutine.

In assembly language, this construct can be optimized away. For example, in 6502 assembly, if a subroutine looks like:

sub: ... jsr othersub rts

the last two lines can be optimized to a jump instruction:

jmp othersub

The subroutine othersub will then return to the return address of sub. If the call stack does not just contain the return address, but also parameters for the subroutine, it may need to be adjusted.

If a subroutine performs a tail call on itself, this is called tail recursion. This can be optimized to a form of iteration, an optimization performed by interpreters of functional programming languages.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Tail call elimination — Eine rekursive Funktion f ist endrekursiv (englisch: tail recursive) (auch endständig rekursiv, iterativ rekursiv, repetitiv rekursiv), wenn der rekursive Funktionsaufruf die letzte Aktion zur Berechnung von f ist.[1] Vorteil dieser… …   Deutsch Wikipedia

  • Tail recursion — In computer science, tail recursion (or tail end recursion) is a special case of recursion in which the last operation of the function is a recursive call. Such recursions can be easily transformed to iterations. Replacing recursion with… …   Wikipedia

  • Tail recursive — Eine rekursive Funktion f ist endrekursiv (englisch: tail recursive) (auch endständig rekursiv, iterativ rekursiv, repetitiv rekursiv), wenn der rekursive Funktionsaufruf die letzte Aktion zur Berechnung von f ist.[1] Vorteil dieser… …   Deutsch Wikipedia

  • Call sign — In broadcasting and radio communications, a call sign (also known as a callsign or call letters, or abbreviated as a call, or otherwise known as a handle) is a unique designation for a transmitting station. In some countries they are used as… …   Wikipedia

  • Tail Concerto — Infobox VG title = Tail Concerto caption = developer = CyberConnect2 publisher = Bandai (JP, PAL) Atlus (NA) designer = engine = released = vgrelease|JP=1998 06 30|NA=1999 10 25|PAL=1999 genre = Action adventure, Platformer modes = Single player… …   Wikipedia

  • Call stack overflow — Dépassement de pile En informatique, un dépassement de pile ou débordement de pile (en anglais, stack overflow) est un bogue causé par un processus qui, lors de l écriture dans une pile, écrit à l extérieur de l espace alloué à la pile, écrasant… …   Wikipédia en Français

  • Long-tail traffic — This article covers a range of tools from different disciplines that may be used in the important science of determining the probability of rare events. The terms long range dependent , self similar and heavy tailed are very close in meaning.… …   Wikipedia

  • List of Fairy Tail members — The fictional members of the guild Fairy Tail are the main characters of the manga Fairy Tail . While one of the strongest mage guilds in the country, Fairy Tail is disliked by the Magic Council because they often cause a lot of unnecessary… …   Wikipedia

  • List of Fairy Tail villains — The following is a list of villains in the manga Fairy Tail. They are listed in order of appearance.Daybreak arcDuke Everlue Owner of a giant mansion containing a book that must be destroyed via a mission Natsu and Lucy have accepted. He has a… …   Wikipedia

  • List of Saint Tail characters — This is a list of known characters in the anime and manga series Saint Tail. Contents 1 Main characters 1.1 Meimi Haneoka / Saint Tail 1.2 Daiki Asuka Jr. 1.3 …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”