Lets say I have such naive implementation of program which recursively adds ones to a given number.
s=lambda n, i: i>0 and s(n+1, i-1) or n
However it won't add more than recursion limit. Such call with default recursion limit would fail:
s(0, 1000000)
Is there a way, how to solve it with recursion but without limit change?
I thought about the way where I call this function 900 times, if number still greater than 0, I add those 900 to some number, reduce added number by 900 and call this function once more. But can't handle how to write such lambdas.