[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 7 logical-xor implementations in source tree

From: Andy Moreton
Subject: Re: 7 logical-xor implementations in source tree
Date: Tue, 23 Jul 2019 11:26:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)

On Tue 23 Jul 2019, Mattias Engdegård wrote:

> 23 juli 2019 kl. 10.39 skrev Andy Moreton <address@hidden>:
>> Is `logxor' what you are looking for ? Removing duplication would be
>> useful.
> Pretty sure he meant boolean (nil/non-nil) xor, not bitwise xor.

Yes. The naming of the bitwise operations `logand', `logior', `logxor'
and `lognot' is unfortunate.

> Some naïve suggestions:
> * Call it `xor', to go with `and' and `or'
> * Make it n-adic, taking at least 1 argument (since the operation has no 
> identity)
> * Make it a function, so that it can be used with `apply' etc.
> * Give it a compiler macro, for efficient partial application

Perhaps an `xor' special form in eval.c next to `and' and `or' ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]