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: Michael Heerdegen
Subject: Re: 7 logical-xor implementations in source tree
Date: Wed, 31 Jul 2019 22:31:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Barry Fishman <address@hidden> writes:

> 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).

Even as a mathematician I would hate the name `iff' when using it in
Elisp which is not a language for writing mathematical stuff but for
writing code.  If you see something like

  (iff EXPR1 EXPR2)

in code, how does it read?  "If and only if evaluating EXPR1 yields
non-nil then - ehm ...??? eh - what? -- ah, ok, let's see, I remember,
it was just the negation of xor, so it actually means..." etc.
Terrible.

Michael.



reply via email to

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