From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Replace trivial pcase occurrences in the Emacs sources Date: Wed, 24 Oct 2018 20:35:08 +0300 Message-ID: <83a7n3s0xf.fsf@gnu.org> References: <20151216202605.GA3752@acm.fritz.box> <8760zakb7q.fsf@fencepost.gnu.org> <56892BDA.6060103@dancol.org> <871t9yk98g.fsf@fencepost.gnu.org> <568936F0.3060505@yandex.ru> <87wprqitj5.fsf@fencepost.gnu.org> <56893C8C.3060200@yandex.ru> <87oad2irtd.fsf@fencepost.gnu.org> <5689456A.1010601@yandex.ru> <87egdy8tyz.fsf@fencepost.gnu.org> <56895FDE.4060406@yandex.ru> <8760za8r4a.fsf@fencepost.gnu.org> <87h9iunkcg.fsf@web.de> <87h8hc4xw2.fsf_-_@web.de> <83tvlcsnee.fsf@gnu.org> <87pnw037ar.fsf@web.de> <83ftwvs7y9.fsf@gnu.org> <877ei7mkfh.fsf@web.de> <83d0rzs680.fsf@gnu.org> <8736svmjkt.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1540402464 25938 195.159.176.226 (24 Oct 2018 17:34:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2018 17:34:24 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 24 19:34:20 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFN2x-0006dp-TF for ged-emacs-devel@m.gmane.org; Wed, 24 Oct 2018 19:34:20 +0200 Original-Received: from localhost ([::1]:49574 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFN54-0007Bt-Dr for ged-emacs-devel@m.gmane.org; Wed, 24 Oct 2018 13:36:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFN48-0007AZ-BA for emacs-devel@gnu.org; Wed, 24 Oct 2018 13:35:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFN40-00052f-Ja for emacs-devel@gnu.org; Wed, 24 Oct 2018 13:35:30 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFN3t-000509-19; Wed, 24 Oct 2018 13:35:19 -0400 Original-Received: from [176.228.60.248] (port=2801 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gFN3q-0007E8-Eg; Wed, 24 Oct 2018 13:35:16 -0400 In-reply-to: <8736svmjkt.fsf@web.de> (message from Michael Heerdegen on Wed, 24 Oct 2018 17:48:50 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:230637 Archived-At: > From: Michael Heerdegen > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Wed, 24 Oct 2018 17:48:50 +0200 > > Eli Zaretskii writes: > > > I agree with the "trivial" part, but why cl-case and not cond (with > > the same "trivial" caveat)? > > Just because `cl-case' fits better? - for an equivalent rewrite using > `cond', I need to define an extra local variable to bind the treated > value to, event a name for it (we speak about ~ 300 cases!) and all cond > branches would look equally like (eq VAR 'VAL). Not an improvement in > readability in my mind. I guess we will have to disagree about that. At the very least, you require people to be acquainted with cl-case well enough. And if repeating (eq foo 'bar) is the issue, you can use assoc and a data structure, see my other message. Just a thought.