Fun with lambda and map

Jason Orendorff jason at jorendorff.com
Wed Feb 6 13:24:21 EST 2002


ivo wrote:
> (btw, I got a solution by email that is pure lambda, but I
> first have to figure out how it works)

I meant to send it to the list.

fac = lambda n: n(lambda c: lambda q:
                  q(succ(c(true)))(mul(c(true), c(false)))
                  )(lambda q: succ(zero))(false)

Be careful; it's O(n!).  <wink>

my-code-runs-real-fast-it's-that-darn-to_int-function-ly y'rs,
## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list