From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Replace trivial pcase occurrences in the Emacs sources Date: Fri, 26 Oct 2018 11:34:32 -0400 Message-ID: References: <20151216202605.GA3752@acm.fritz.box> <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> <83r2geqe15.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540568905 2038 195.159.176.226 (26 Oct 2018 15:48:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2018 15:48:25 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 26 17:48:21 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 1gG4LQ-0000JB-U0 for ged-emacs-devel@m.gmane.org; Fri, 26 Oct 2018 17:48:17 +0200 Original-Received: from localhost ([::1]:60738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG4NX-0007hq-ER for ged-emacs-devel@m.gmane.org; Fri, 26 Oct 2018 11:50:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG4J0-0003mJ-8N for emacs-devel@gnu.org; Fri, 26 Oct 2018 11:45:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gG48B-0005yd-Qo for emacs-devel@gnu.org; Fri, 26 Oct 2018 11:34:40 -0400 Original-Received: from alt42.smtp-out.videotron.ca ([23.233.128.29]:44136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gG48B-0005y7-I3 for emacs-devel@gnu.org; Fri, 26 Oct 2018 11:34:35 -0400 Original-Received: from fmsmemgm.homelinux.net ([23.233.195.134]) by Videotron with SMTP id G489ggmckM6QEG48Ag2PbY; Fri, 26 Oct 2018 11:34:34 -0400 X-Authority-Analysis: v=2.3 cv=bq5i+nSi c=1 sm=1 tr=0 a=xXJ578j8WyTliCxld3/pTA==:117 a=xXJ578j8WyTliCxld3/pTA==:17 a=smKx5t2vBNcA:10 a=dscXP1FK4jX9ng0ezQ8A:9 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 046F8AE31A; Fri, 26 Oct 2018 11:34:32 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Thu, 25 Oct 2018 11:32:39 -0400") X-CMAE-Envelope: MS4wfLfNmEo9TEu4nJ2MhVAI9wmUzmI04VhF9ChqEspLV2mBHQhZsJ6tfbABqAaZL16C7C1M10DZMmoewJSzy+NAMAXAabDoqrh8QauHAa7mGCxplKEoGcgg 4fHIK9GpDIO5L8kEVPy+/oovrJWKtkxZLHqZPF1aKEMPKEFdpQfZDwIq+uoRZB5xx7NeMLbwS7yLpl0ABP2KzKbzjsS3S+Vd6XpLM+jhV2RGxnarA9z7yAIW 3Yjk4/EvBWPhs02ZTKpfLg== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 23.233.128.29 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:230711 Archived-At: > (pcase this-param > ('edit (todo-edit-item--text)) > ('header (todo-edit-item--text 'include-header)) > ('multiline (todo-edit-item--text 'multiline)) > ('add/edit (todo-edit-item--text 'comment-edit)) > ('delete (todo-edit-item--text 'comment-delete)) > > I have a hard time believing that there are more users who find it less > clear than its cond+eq expansion. BTW, I just bumped into another benefit of `pcase` for such code: When I converted a particular cond+eq thingy yesterday, pcase gave me a warning about redundant pattern, because indeed one of the original `cond` branches was unreachable. Stefan