emacs-devel
[Top][All Lists]
Advanced

[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




reply via email to

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