4 ms·
One additional comment, regarding the "fac1" functional above: >>> fac1 = lambda f: lambda n: ((n > 1) and n * f(n-1) or 1) If you happened to have a functi
by gregfjohnson 3y ago
One additional comment, regarding the "fac1" functional above:
>>> fac1 = lambda f: lambda n: ((n > 1) and n * f(n-1) or 1)
If you happened to have a function "my_fac" that calculates the factorial function, and you applied "fac1" above to that function, you would get a new implementation of the factorial function, that calls your my_fac function internally. In other words, "my_fac" is a fixed point of fac1:
>>> fac1(my_fac)
is the same function as my_fac.