From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: The poor state of documentation of pcase like things. Date: Fri, 1 Jan 2016 07:18:47 -0800 (PST) Message-ID: References: <<20151216202605.GA3752@acm.fritz.box> > < > < <87io3m60bq.fsf@web.de>> < <877fk1nnk0.fsf@web.de>> <<8760zlue3j.fsf@gmail.com> <87vb7kajgv.fsf@web.de>> <<83y4c9ag06.fsf@gnu.org>> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1451661565 3740 80.91.229.3 (1 Jan 2016 15:19:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Jan 2016 15:19:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii , Michael Heerdegen , John Wiegley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 01 16:19:12 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aF1Tz-0003Rc-0u for ged-emacs-devel@m.gmane.org; Fri, 01 Jan 2016 16:19:11 +0100 Original-Received: from localhost ([::1]:36084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aF1Ty-00070b-Aw for ged-emacs-devel@m.gmane.org; Fri, 01 Jan 2016 10:19:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aF1Tm-00070V-A8 for emacs-devel@gnu.org; Fri, 01 Jan 2016 10:18:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aF1Tl-0007xB-I9 for emacs-devel@gnu.org; Fri, 01 Jan 2016 10:18:58 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:48696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aF1Th-0007vt-Nn; Fri, 01 Jan 2016 10:18:53 -0500 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u01FIoA5017193 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 1 Jan 2016 15:18:51 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u01FInZb012513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 1 Jan 2016 15:18:49 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u01FImiP023487; Fri, 1 Jan 2016 15:18:49 GMT In-Reply-To: <<83y4c9ag06.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:197308 Archived-At: > Btw, could someone please tell what are the benefits of using 'pcase' > in snippets like this one: >=20 > (pcase skip > (`nil nil) > (`0 t) > (_ (setq i (+ i skip -1)) (funcall get-next-frame))))))) >=20 > How is this different from using 'cond' in trivial ways? >=20 > (I see quite a few of such uses of 'pcase' in the sources, and when I > read them, I always wonder what is it that I'm missing about that > code.) FWIW, I noticed the same thing a while ago. Seems like someone went on a `pcase' rampage, or perhaps was just overly enthusiastic with a new toy. ("Ooooh - shiny!") We should use `pcase' when it really helps, including helps make reading the code easier. And hopefully some real use of pattern matching would typically be involved (i.e., decomposition, not just matching `nil' or `0' or "abc" literally).