[Top][All Lists]

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

RE: 7 logical-xor implementations in source tree

From: Drew Adams
Subject: RE: 7 logical-xor implementations in source tree
Date: Wed, 31 Jul 2019 16:20:57 -0700 (PDT)

> > Why is it important that Emacs Lisp have such
> > an operator?  (Answer: it's not - YAGNI.)
> If YAGNI, why are there currently 7 copies of this function in the
> Emacs sources?

Dunno.  I probably wouldn't have added them.

OK, so we have 7 definitions of a trivial function.
How many occurrences of those 7 functions?  Do their
uses really benefit from defining such a function?
(How about just replacing all of them by sexps?)

> No-one said it's vitally important; it's just a minor nice-to-have.

Just 1 opinion: too minor and not nice enough to have.

> > Is it hard to understand (eq (not a) (not b))?
> > Is evaluation of that inefficient?  Is it too
> > verbose?  What's the motivation for all of this?
> Same reason proper-list-p was added: reducing existing code duplication
> and providing yet another convenience function for those that like it.

I see.  You added `proper-list-p' also.  Also missing
from Common Lisp, FWIW.

How much real code duplication did adding that predicate
eliminate?  At least in that case the code replaced is,
even if straightforward and not very verbose, not
completely trivial.

I don't object strongly to adding such functions.
But I'd expect a convenience function to typically be
more convenient - replace more than a few occurrences
of more complex code.

reply via email to

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