Anonymous user
Tail Recursion and Tail Call Optimization: Difference between revisions
Jump to navigation
Jump to search
Tail Recursion and Tail Call Optimization (view source)
Revision as of 06:38, 28 March 2023
, 1 year ago→What is a tail call?
[unchecked revision] | [unchecked revision] |
(Okay, I delayed this way more than I thought I would...) |
|||
Line 1:
== What is a tail call? ==
Informally, a tail call is when a function calls another function, and returns immediately. In assembly, it's when a CALL and a RET instructions are found right next to each other. For example, in the following code:
Line 46 ⟶ 44:
As you can see, there is no operation between <code>CALL</code> and <code>RET</code> this time.
== Optimizing a tail call ==
|