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: Sat, 2 Jan 2016 18:48:52 -0800 (PST) Message-ID: <99364c8d-ba83-4e10-8345-5bd8dc926e7d@default> 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> <87bn95m9eg.fsf@fencepost.gnu.org> <5686CDFB.2010105@dancol.org> <83fuygcs5g.fsf@gnu.org> <56886E32.70305@yandex.ru> 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 1451789369 9519 80.91.229.3 (3 Jan 2016 02:49:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2016 02:49:29 +0000 (UTC) Cc: michael_heerdegen@web.de, Eli Zaretskii , Daniel Colascione , dak@gnu.org, emacs-devel@gnu.org To: Lars Magne Ingebrigtsen , Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 03 03:49:16 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 1aFYjL-0003eT-Q0 for ged-emacs-devel@m.gmane.org; Sun, 03 Jan 2016 03:49:15 +0100 Original-Received: from localhost ([::1]:40325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFYjK-00083g-S1 for ged-emacs-devel@m.gmane.org; Sat, 02 Jan 2016 21:49:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFYjH-00083O-Ay for emacs-devel@gnu.org; Sat, 02 Jan 2016 21:49:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFYjG-0006TP-GU for emacs-devel@gnu.org; Sat, 02 Jan 2016 21:49:11 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:37354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFYjA-0006Rk-Oj; Sat, 02 Jan 2016 21:49:04 -0500 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u032muN0015877 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 3 Jan 2016 02:48:56 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u032mtpH015570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 3 Jan 2016 02:48:55 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u032mrsa017613; Sun, 3 Jan 2016 02:48:54 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] 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:197400 Archived-At: > Well, I'd say that pcase is kinda awkward because you can't tell by > skimming whether it's complex or not 100% agreement. That's really the point, for me. * `pcase' shouts: "This might be complicated. Better look closely." * `cond' and `cl-case' and `if' ... shout: "Nothing fancy here. We're only testing literals" > (pcase status-symbol ...) >=20 > The only way you'll know whether `status-symbol' is really a symbol, and > all the cases are really symbols, is by reading the entire thing. The > 44th case could have been (_ foo bar zot), for instance. >=20 > (case status-symbol ...) >=20 > and you'd know that this was a simple `eql' thing going on here. >=20 > I kinda liked pcase at first, but the more I see of the pcase language, Good one. That's really it. When you have a very general construct it can begin to be its own _language_. This is the case for UNIX `find', for instance, and for Common Lisp `loop'. That's not to say that using such a language can't be useful. It's only to say that I use it when it is most useful. If I don't need it then I tend not to use it. > the more sceptical I get. I'm beginning to wonder whether the whole > thing is a misfeature that should be replaced with several separate > operators. That's an interesting question. Maybe you have something in mind? Could be an interesting thread, even if it ultimately went nowhere. Certainly, something like `pcase' provides a good deal of food for thought, which can also mean room for improvement.