Anonymous user
Anonymous recursion: Difference between revisions
m
→{{header|Python}}
Line 1,316:
Same thing as the above, but modified so that the function is uncurried:
<lang python>>>>from functools import partial
>>> fib = lambda f, n: None if n < 0 else (0 if n == 0 else (1 if n == 1 else f(n-1) + f(n-2)))
>>> [ Y(fib)(i) for i in range(-2, 10) ]
|