- Learn Scala Programming
- Slava Schmidt
- 67字
- 2025-02-24 07:23:51
Recursion and trampolining
There is a special case of a function calling another function—the function calling itself. Such functions are called recursive. Recursive functions can be head-recursive or tail-recursive. There is also an approach to model recursive calls in an object-oriented way called trampolining. Recursion is very convenient and often uses the technique in functional programming, so let's take a close look at these concepts.