Tail call and Tail-call Optimization (TCO)
Tail call & Tail-recursion
Assume that function A
calls function B
. We call function A
Caller and function B
Callee.
The tail call refers to when the Caller only needs to wait for the return value of the Callee, as everything else has already been completed1.
If this is a recursive function call(e.g. the Caller and Callee are the same function), then the function is said to be tail-recursive.