[Top][All Lists]

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

Re: 7 logical-xor implementations in source tree

From: Paul Eggert
Subject: Re: 7 logical-xor implementations in source tree
Date: Tue, 23 Jul 2019 10:48:23 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Mattias EngdegÄrd wrote:

I would probably use the negation, boolean equivalence, more often than xor 

Me too. This was also Dijkstra's opinion (I attended an infamous lecture by him on the subject).

define-inline in particular will produce decent code.

I don't think performance is much of a concern here, and would favor defining them as functions instead; that's simpler and allows them to be used in more contexts when code is written using a functional style.

+(defmacro equiv (&rest args)
+  "Boolean equivalence: t if arguments are all non-nil or all nil."

When equiv has one or more arguments and they are all non-nil, it might be more useful for equiv to return its last argument instead of returning t. Of course I'm bike-shedding here....

reply via email to

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