From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: Replace trivial pcase occurrences in the Emacs sources Date: Wed, 24 Oct 2018 17:48:50 +0200 Message-ID: <8736svmjkt.fsf@web.de> 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540396026 4714 195.159.176.226 (24 Oct 2018 15:47:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2018 15:47:06 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 24 17:47:02 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 1gFLN7-00017E-N3 for ged-emacs-devel@m.gmane.org; Wed, 24 Oct 2018 17:47:01 +0200 Original-Received: from localhost ([::1]:49117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFLPE-0003Mn-A8 for ged-emacs-devel@m.gmane.org; Wed, 24 Oct 2018 11:49:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFLP3-0003MX-Q2 for emacs-devel@gnu.org; Wed, 24 Oct 2018 11:49:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFLP0-0006s6-JG for emacs-devel@gnu.org; Wed, 24 Oct 2018 11:49:01 -0400 Original-Received: from mout.web.de ([212.227.15.4]:58387) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFLP0-0006rb-9E; Wed, 24 Oct 2018 11:48:58 -0400 Original-Received: from drachen.dragon ([94.218.210.177]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lk8Ow-1filo13KcU-00c6Kh; Wed, 24 Oct 2018 17:48:51 +0200 Original-Received: from drachen.dragon ([94.218.210.177]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lk8Ow-1filo13KcU-00c6Kh; Wed, 24 Oct 2018 17:48:51 +0200 In-Reply-To: <83d0rzs680.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 24 Oct 2018 18:40:47 +0300") X-Provags-ID: V03:K1:Eis2N6VW+dzRayAZkQkS2B6to1eqtJAkA1cLzFOc8P1gkYwQKCV D8Hh9ZIxjjXWsov59ABYbQqrO5AhE681iTG2okkHx89hBSOHsBzmf6U1RWUtDNYAzx3hM7u MtL5VR2CPQDU98Kk7qP7Uov33GSCdNFkpPJKSj3H1413aAMS3E438gYl2a2AWOuH3CRcWKZ gWT5oNgJwddE8dRLmUS3g== X-UI-Out-Filterresults: notjunk:1;V01:K0:AurGrzh8TFU=:tkVby4/ZuIiqEAzm9DL3Pi j22IZCQF7rv+Aw9jiygmFOBOkFf4MKJCMJtVzXnFHMr1HgtnlmL53/VI5Ygo01/+SdpOykLCQ r4HiEYHRPl8jfYZ3QaFbXj/iv0hmj6CLPPnkKm+dVPD7KHPnaqWH5pA9KuJJ0IMPX9U4rJIfI Q9Ya4w5Zu1dI/6nxJ/cbOnZmovxobIKpueCOSTT815o4xCtH0KgxY2+8ufqyNf/05W7be38OW 2repJARhAbt2pONYi15//og9n9gDuH0TaWelYfHIzoRqoc1zOagE7B+auSj1Kh36o5kBoFw1W BNtA+NyMGiBBxtMbqTtJEBaHjxoOvMEhkomXBYEB7qAWzlCsdrmgp8ZEM9kzzf2k0jyMyGVWD PDTNRq1WIlW9lLPxq7lIO+DU7PBJDGHQaKlj3KjpSVB8YkO44wYFAzafcfy3+P65Po9T4nTA1 KclhUGYtcAQcpeSBaPi10/qGGHV3r3RGDDNDlVna+W+ifaFdgsCS3/DfK0wIL7OB58Ylyss/Y bcYi3S5luGmbKDxU554zzxg0JVYqn7lq+nv85WlPaDscRc9I5cTGGVemPF1eA5PP3Cjv5U8mx uV8fFWZIRvAcHBOcDp4enjaixqrjqNQ26GhG1snOm7efXh1AffqWMvLtxHdj1Rxse1uP2He+b d39g942ibrl5MisZiLD64a8iXIyknJSSAkxxvhqlVscP3AWIBIbs1NCAMZij4rtyESlspn/vy rhB76xEqHzVZC+2ixNecQq8nyKWrdECQSTkmXPJQFVMtoXGeQmewCGzyf/Opndbx+fGqrAXH X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.4 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:230634 Archived-At: 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. There is a minority (around ~ 20 cases) that look like (pcase EXPR ('X1 foo1) ('X2 foo2) ... (VAR EXPR-USING-THE-VAR)) with a catchall last branch that already use a variable binding. These would fit a bit better to `cond', but as said, that's a minority. Michael.