[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 7 logical-xor implementations in source tree
From: |
Stefan Monnier |
Subject: |
Re: 7 logical-xor implementations in source tree |
Date: |
Tue, 23 Jul 2019 08:38:39 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> * Call it `xor', to go with `and' and `or'
Fine.
> * Make it n-adic, taking at least 1 argument (since the operation has no
> identity)
I'm not convinced it's worth the trouble (we only have 7 uses so far
and they all seem happy with a 2-arg xor).
Especially since there are 2 different reasonable semantics.
It can always be extended later if needed.
> * Make it a function, so that it can be used with `apply' etc.
It's naturally a function, indeed.
> * Give it a compiler macro, for efficient partial application
Given how rarely it's used, I'm not sure it's worth the trouble.
Luckily if we only accept the 2-args case this can be done very cheaply
with defsubst or define-inline.
Stefan
- Re: 7 logical-xor implementations in source tree, (continued)
- Re: 7 logical-xor implementations in source tree, Andy Moreton, 2019/07/23
- Re: 7 logical-xor implementations in source tree, Andreas Schwab, 2019/07/23
- Re: 7 logical-xor implementations in source tree, Andy Moreton, 2019/07/23
- Re: 7 logical-xor implementations in source tree, Basil L. Contovounesios, 2019/07/23
- Re: 7 logical-xor implementations in source tree, Andy Moreton, 2019/07/23
- Re: 7 logical-xor implementations in source tree, Basil L. Contovounesios, 2019/07/24
- Re: 7 logical-xor implementations in source tree, Basil L. Contovounesios, 2019/07/23
- Re: 7 logical-xor implementations in source tree, Yuri Khan, 2019/07/23
- Re: 7 logical-xor implementations in source tree, Juri Linkov, 2019/07/25
- Re: 7 logical-xor implementations in source tree, Noam Postavsky, 2019/07/23
- Re: 7 logical-xor implementations in source tree,
Stefan Monnier <=
- Re: 7 logical-xor implementations in source tree, Mattias EngdegÄrd, 2019/07/23
- Re: 7 logical-xor implementations in source tree, Eli Zaretskii, 2019/07/23
- Re: 7 logical-xor implementations in source tree, Paul Eggert, 2019/07/23
- Re: 7 logical-xor implementations in source tree, Stefan Monnier, 2019/07/23