Aktuelle Änderungen Printable View Änderungen Bearbeiten
StevenLevy > StoredProcedures > StructuredQueryLanguage > SymbolicProgramming > SyntacticAbstraction > SystemBackup > SystemBackups > SystemBackup > TFS > TeamFoundationServer > TShirts > TailCallElimination > Recursion > TailCallOptimization > Recursion > TailRecursionElimination > RecursionClear Trail
Tail recursion is interesting because it is form of recursion that can be implemented much more efficiently than general recursion. In general, a recursive call requires the compiler to allocate storage on the stack at run-time for every call that has not yet returned. This memory consumption makes recursion unacceptably inefficient for representing repetitive algorithms having large or unbounded size. Tail recursion is the special case of recursion that is semantically equivalent to the iteration constructs normally used to represent repetition in programs. Because tail recursion is equivalent to iteration, tail-recursive programs can be compiled as efficiently as iterative programs. [1]
A compiler is said to implement TailRecursion if it recognizes this case and replaces the caller in place with the callee, so that instead of nesting the stack deeper, the current stack frame is reused.[2]
Object-oriented programming in languages that don't require tail-call optimizations makes no sense. MatthiasFelleisen