A tail call is the final operation performed by a function. Elixir, through Erlang's execution model, can replace the caller's stack push with a jump, allowing the callee to reuse the caller's execution frame and consume no additional memory. section 3.4.2
Tail calls are especially useful for recursion. A function that calls itself at the end can continue through arbitrarily large iterations without accumulating stack frames. The usual pattern separates a public function from a private recursive helper carrying an accumulator. section 3.4.2
Tail-recursive list summation
ListHelper.sum/1 starts with an accumulator of zero, while do_sum/2 adds each head to the accumulated value and tail-calls itself with the remaining list. The empty-list clause returns the accumulated sum.
