|
|
|
|
|
by YeGoblynQueenne
3533 days ago
|
|
Recursion is frequently used as progressive iteration, but it can go further than that. Typical example, a factorial function, in Erlang: factorial(N) ->
factorial(N,1).
factorial(0, F) -> F;
factorial(N, F) ->
factorial(N-1, N*F).
It's strange to read that as iteration. Instead it feels natural to describe it as composition from parts that are of the same kind as the whole. |
|