[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 7 logical-xor implementations in source tree
From: |
Barry Fishman |
Subject: |
Re: 7 logical-xor implementations in source tree |
Date: |
Wed, 31 Jul 2019 11:20:12 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
On 2019-07-30 23:16:16 -04, Richard Stallman wrote:
> Me:
> > I find the iff and xor not obvious. xor seems like it should be the
> > bitwise operation.
>
> That operation is called logxor. It goes with logior and logand.
I can see keeping the Common Lisp names for things. Emacs does that
with CAR and CDR. I have concerns with just replacing one set of
confusing names with others that have differing semantics in other languages..
CL has AND, OR and NOT. Like CLISP, Emacs has added XOR, but (I think)
with less useful semantics than CLISP's.
I question whether IFF is really that clear. If you want to be
mathematical, just use <=> or ===, and can be complete by defining the
=> implementation operator also:
(defun <=> (x y) (not (xor x y)))
Or:
(defun => (x y) (or (not x) y)
(defun <=> (x y) (and (=> x y) (=> y x))
At least mathematicians will be happy (and nix programmers).
And possibly give XOR CLISP semantics: takes multiple arguments
returning NIL unless just one argument is true, in which case return
that argument.
--
Barry Fishman
- Re: 7 logical-xor implementations in source tree, (continued)
- Re: 7 logical-xor implementations in source tree, Mattias EngdegÄrd, 2019/07/25
- Re: 7 logical-xor implementations in source tree, Philippe Schnoebelen, 2019/07/28
- Re: 7 logical-xor implementations in source tree, Alan Mackenzie, 2019/07/28
- Re: 7 logical-xor implementations in source tree, Marcin Borkowski, 2019/07/28
- Re: 7 logical-xor implementations in source tree, Alan Mackenzie, 2019/07/30
- Re: 7 logical-xor implementations in source tree, Philippe Schnoebelen, 2019/07/30
- Re: 7 logical-xor implementations in source tree, Andy Moreton, 2019/07/30
- Re: 7 logical-xor implementations in source tree, Stefan Monnier, 2019/07/30
- Re: 7 logical-xor implementations in source tree, Barry Fishman, 2019/07/30
- Re: 7 logical-xor implementations in source tree, Richard Stallman, 2019/07/30
- Re: 7 logical-xor implementations in source tree,
Barry Fishman <=
- Re: 7 logical-xor implementations in source tree, Stefan Monnier, 2019/07/31
- Re: 7 logical-xor implementations in source tree, Basil L. Contovounesios, 2019/07/31
- Re: 7 logical-xor implementations in source tree, Michael Heerdegen, 2019/07/31
- Re: 7 logical-xor implementations in source tree, Mattias EngdegÄrd, 2019/07/31
- Re: 7 logical-xor implementations in source tree, Basil L. Contovounesios, 2019/07/31
- Re: 7 logical-xor implementations in source tree, Michael Heerdegen, 2019/07/31
- RE: 7 logical-xor implementations in source tree, Drew Adams, 2019/07/31
- RE: 7 logical-xor implementations in source tree, Drew Adams, 2019/07/31
- Re: 7 logical-xor implementations in source tree, Basil L. Contovounesios, 2019/07/31
- RE: 7 logical-xor implementations in source tree, Drew Adams, 2019/07/31