Alec Taylor <alec.tayl...@gmail.com> writes:

> On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
> <steve+comp.lang.pyt...@pearwood.info> wrote:

>> def true(x, y):
>>    return x
>>
>> def false(x, y):
>>    return y
[...]
>> def Nand(a, b):
>>    return (lambda c: lambda x, y: c(y, x))(a(b, a))
>>
>> and we're done. [...]

> Awesome

Yes, that's how Church defined booleans in the lambda calculus. See
http://en.wikipedia.org/wiki/Church_encoding for encodings of natural
numbers and lists.

-- Alain.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to