by i2 · 14y ago · 0 comments
>>> ZERO = lambda f: lambda x: x
>>> FIVE = lambda f: lambda x: f(f(f(f(f(x)))))
>>> to_int = lambda f: f(lambda x: x+1)(0)
... etc.http://perl.plover.com/lambda/ aka "How to write a 163 line program to compute 1+1"
Although I really like the OP's approach since he slowly morphs a program his readers can understand, rather than constructing a programming system from scratch.
https://raw.github.com/sdiehl/church-numbers/master/church.p...