[racket] Boolean expressions [Was: static variables question]

From: Rodolfo Carvalho (rhcarvalho at gmail.com)
Date: Sun Feb 19 14:33:03 EST 2012

On Sun, Feb 19, 2012 at 17:03, Hendrik Boom <hendrik at topoi.pooq.com> wrote:

>
> The trouble is, I can never remember which of 'nand' and 'nor' is
> which.  Either of them could mean 'neither'.  But I do know what
> 'neither' means.
>
>
Think of them as composed boolean functions:
- nand is "not and"
- nor is "not or"

`and' is true only when both (all) arguments are true. False otherwise.
`nand' is false only when both (all) arguments are true. True otherwise.

Truth table:
A B (nand A B)
t t f
t f t
f t t
f f t


`or' is false only when both (all) arguments are false. True otherwise.
`nor' is true only when both (all) arguments are false. True otherwise.

A B (nor A B)
t t f
t f f
f t f
f f t


So, when you say 'neither' you mean 'nor'.



Ah, then there's also XOR (eXclusive OR):
True when the arguments are different.

A B (xor A B)
t t f
t f t
f t t
f f f


Anyway, IMHO I don't see need to have these bindings in #lang racket.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120219/3c0deee4/attachment.html>

Posted on the users mailing list.