From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: 7 logical-xor implementations in source tree Date: Tue, 23 Jul 2019 08:38:39 -0400 Message-ID: References: <87tvbd9a8p.fsf@oremacs.com> <86wog9gn5n.fsf@gmail.com> <7AAB8009-DD68-4EA7-93CC-3B4A89FC8AFD@acm.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="115266"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Andy Moreton , emacs-devel@gnu.org To: Mattias =?windows-1252?Q?Engdeg=E5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 23 14:38:56 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hpu4E-000Tpe-60 for ged-emacs-devel@m.gmane.org; Tue, 23 Jul 2019 14:38:54 +0200 Original-Received: from localhost ([::1]:42100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpu4C-0006bu-TC for ged-emacs-devel@m.gmane.org; Tue, 23 Jul 2019 08:38:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43525) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpu45-0006bL-J9 for emacs-devel@gnu.org; Tue, 23 Jul 2019 08:38:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hpu44-0007ob-IZ for emacs-devel@gnu.org; Tue, 23 Jul 2019 08:38:45 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9707) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hpu44-0007nj-CL for emacs-devel@gnu.org; Tue, 23 Jul 2019 08:38:44 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F3A3B8119A; Tue, 23 Jul 2019 08:38:42 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C747980E08; Tue, 23 Jul 2019 08:38:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1563885521; bh=ndxTLiryLJSxI3aCQhLzDfUC5hBOR2BC9vvN30BLWzw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Z41o8/e58xUQYGqqn+oUiwBocCp9RP+ODwWjI8+XLeNAn0MKKJJYSOvkeGFh4gB3R rVIqVQmysgvG+B0P51Gxev/WR+GQTyb8jp6V+nTaHQBg2Z8rYcHgJIGIBr4ydUqHmq zOQLjBjQA4QZ7nP+JnXYZu+RnfMw0woo3ppERYb5K1Y41hC+PQfrKg4uIsGa9yblqg W2hdnocvC2TBwKP4IOvCrOanJPqn2BW91sIu+bzyX0fGFDU2mJ4aT/RM+jSIt+N2fj yPqrrSO4BhpNJUfegoCYYzUHVpgWEqdnVhk/vZHuhp6PNjtkci5BXpIpLypT/qSM02 4h+/2aql81nRQ== Original-Received: from pastel (unknown [216.154.19.233]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 82E1A120EF7; Tue, 23 Jul 2019 08:38:41 -0400 (EDT) In-Reply-To: <7AAB8009-DD68-4EA7-93CC-3B4A89FC8AFD@acm.org> ("Mattias \=\?windows-1252\?Q\?Engdeg\=E5rd\=22's\?\= message of "Tue, 23 Jul 2019 11:14:42 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238837 Archived-At: > * 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