From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#20268: 25.0.50; pcase-lambda broken Date: Wed, 08 Apr 2015 14:22:46 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1428499484 15007 80.91.229.3 (8 Apr 2015 13:24:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Apr 2015 13:24:44 +0000 (UTC) To: 20268@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 08 15:24:27 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Yfpxl-0002O5-DU for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Apr 2015 15:24:13 +0200 Original-Received: from localhost ([::1]:52789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfpxk-0004q3-M9 for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Apr 2015 09:24:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfpxe-0004n9-Oh for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 09:24:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yfpxa-0002vj-6j for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 09:24:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfpxa-0002vf-4N for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 09:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YfpxZ-0007Vf-R5 for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 09:24:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Apr 2015 13:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20268 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.142849940228819 (code B ref -1); Wed, 08 Apr 2015 13:24:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Apr 2015 13:23:22 +0000 Original-Received: from localhost ([127.0.0.1]:48923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yfpwv-0007Ui-D0 for submit@debbugs.gnu.org; Wed, 08 Apr 2015 09:23:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44118) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yfpws-0007US-OY for submit@debbugs.gnu.org; Wed, 08 Apr 2015 09:23:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yfpwj-0002nO-Na for submit@debbugs.gnu.org; Wed, 08 Apr 2015 09:23:13 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:37301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfpwj-0002nK-KC for submit@debbugs.gnu.org; Wed, 08 Apr 2015 09:23:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfpwi-0004Df-IA for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 09:23:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yfpwb-0002lb-2H for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 09:23:08 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfpwa-0002l7-RO for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 09:23:00 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YfpwW-0001kf-DM for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 15:22:56 +0200 Original-Received: from uk.solarflare.com ([193.34.186.16]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Apr 2015 15:22:56 +0200 Original-Received: from andrewjmoreton by uk.solarflare.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Apr 2015 15:22:56 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: uk.solarflare.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt) Cancel-Lock: sha1:d+CmCwakud96v1rpRj0cy+y8byk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101285 Archived-At: On Tue 07 Apr 2015, Stefan Monnier wrote: >> After the recent rewrite, pcase-lambda is broken. For example, eval the >> following to get 46422 instead of the correct value 65535. > >> (cl-some (pcase-lambda (`[fullsweep_after ,v]) v) >> '([min_bin_vheap_size 46422] >> [min_heap_size 233] >> [fullsweep_after 65535] >> [minor_gcs 40])) > > Indeed, that's the semantics I chose. > The previous semantics was for the function to do nothing and return nil > if the arg doesn't match. The new semantics is the same as the one used > by pcase-let. It's not without its fault of course, but at least it does > correspond to the usual idea of "destructuring" and generates more > efficient code. Please improve the documentation for the pcase macros: a) The elisp manual has reference documentation for pcase, but it is confusing and short on examples. The first example would be clearer if it was more like the second example, by showing some example forms that invoke pcase and the result of evaluating them. The description would flow more logically if the second example followed the reference that describes the allowed patterns, and included an example of each type of pattern. b) Add meaningful help strings for pcase-lambda, pcase-let* and pcase-let. The existing help strings all say that these constructs are "the same as another thing only different" which only serves to obscure what they do. A user should be able to discern what the interface contract is without reading the implementation. A short motivating example for each macro would be helpful. These improvements would make code using the pcase macros more readable, and aid understanding of the intended semantics. AndyM