In the previous section, we were calculating the sum of the numbers between 10 and 15. The program, after some transformations, became equivalent to the following one:
say 10 + (11 + (12 + (13 + (14 + 15))));
Each pair of parentheses here corresponds to the recursive call of the sum function. Calls of the function are replaced here with its implementation. This is one of the consequences of the restriction of the state-less approach. Would the function depend on the program state, it would not be possible to replace the function call with its implementation without knowing the values reflecting the state at different moments.
As parentheses do not change any order of execution here, let's remove them:
say 10 + 11 + 12 + 13 + 14 + 15;
What we see here is a list of all the values between 10 and 15 separated by the + operator. We have already met that in the...