Usefulness of the "not in" operator

Alec Taylor alec.taylor6 at gmail.com
Mon Oct 10 09:36:25 EDT 2011


Unfortunately I don't know lambda [or for that matter, regular] calculus...

On Tue, Oct 11, 2011 at 12:01 AM, Alain Ketterlin
<alain at dpt-info.u-strasbg.fr> wrote:
> Alec Taylor <alec.taylor6 at gmail.com> writes:
>
>> On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
>> <steve+comp.lang.python at 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
>



More information about the Python-list mailing list