From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Cochran Newsgroups: gmane.emacs.bugs Subject: bug#24362: 25.1.50; Inconsistent docstring between pcase-let and pcase-let* Date: Wed, 14 Sep 2016 16:06:57 -0700 Message-ID: <87fup2nkry.fsf@cochranmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1473900862 6371 195.159.176.226 (15 Sep 2016 00:54:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Sep 2016 00:54:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: 24362@debbugs.gnu.org To: Chunyang Xu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 15 02:54:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1bkKwP-0000hw-Lu for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Sep 2016 02:54:15 +0200 Original-Received: from localhost ([::1]:59375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkKwN-0003ng-OZ for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Sep 2016 20:54:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkKwH-0003nb-Nx for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 20:54:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkKwE-0005cm-PD for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 20:54:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkKwE-0005ca-Ik for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 20:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bkKwE-0005rm-7V for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 20:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Cochran Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Sep 2016 00:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24362 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24362-submit@debbugs.gnu.org id=B24362.147390082622529 (code B ref 24362); Thu, 15 Sep 2016 00:54:02 +0000 Original-Received: (at 24362) by debbugs.gnu.org; 15 Sep 2016 00:53:46 +0000 Original-Received: from localhost ([127.0.0.1]:59915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkKvy-0005rI-Dj for submit@debbugs.gnu.org; Wed, 14 Sep 2016 20:53:46 -0400 Original-Received: from mail.workgrouplinux.net ([207.195.177.82]:55185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkKvw-0005r9-JB for 24362@debbugs.gnu.org; Wed, 14 Sep 2016 20:53:45 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=simple; d=cochranmail.com; h=from:to :cc:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=dkim1; bh=0aeP52Ta5xUoEwov7aBfdTCjqds=; b=jtmi+ 0R4llEMHK5K9UB4J8bWNQB/TZBZMFBm94zjA5c8yTNgESzKv5iWn/kGySkZU9VF0 3r0Gzijlmk0K7teRFQsAXx7gNZNgRI4qXzOMijFZ018+5J9biLixBrsXChcvbqcQ Esx9FPU4Y/D9BuJzeP2rE9xcAonQ6qAK5Z2JyuiV/bXm+lZUYsf0Za3zI/ofJNIk f//VeyEI7wsS3XW0ChgBvVxAshC984m1jUOspyw6RyBJTEsPQ6gDZcemW5pH5eEC rEIqSh0gJiALyOHEwWTDPqtcQJIfryZa/pu3YZMM+Uv4icYZSX9vXLsBSMHpfmDl Menxxbv+lRZcKw4Vg== Original-Received: (qmail 4526 invoked by uid 0); 14 Sep 2016 23:07:00 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=private; d=cochranmail.com; b=N1PlYwfCXo7DZmeRtjb2YBBGZtXAtQEmqW9l/gvJ76vYpKianPkOzlI+UOKyGdLHb6F0mTmtFgCgmCKNJiTnyg==; Original-Received: from 131-191-86-130.as.clicknet.org (HELO SoraLaptop) (robert@cochranmail.com@131.191.86.130) by mail.cochrantribe.org with ESMTPA; 14 Sep 2016 23:07:00 -0000 In-Reply-To: (Chunyang Xu's message of "Sun, 04 Sep 2016 12:26:05 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:123316 Archived-At: --=-=-= Content-Type: text/plain Chunyang Xu writes: > It looks like, to me, the structure of the BODY arg of these two should > be the same (accepting a list froms). > > (pcase-let ((a 1)) > (incf a) > a) > => 2 > > (pcase-let* ((a 1)) > (incf a) > a) > => 2 It appears to be so. Here's what I did: (pcase-let* ((a 1) (b 2)) (message "%d" a) (message "%d" b)) and ended up with 1 2 in my *Messages* buffer. > but the docstrings are using the different words. > > (pcase-let BINDINGS &rest BODY) > > Like `let' but where you can use `pcase' patterns for bindings. > BODY should be a list of expressions, and BINDINGS should be a list of bindings > ^^^^^^^^^^^^^^^^^^^^^ > of the form (PAT EXP). > > (pcase-let* BINDINGS &rest BODY) > > Like `let*' but where you can use `pcase' patterns for bindings. > BODY should be an expression, and BINDINGS should be a list of bindings > ^^^^^^^^^^^^^ > of the form (PAT EXP). This patch changes the pcase-let* docstring to match the pcase-let docstring, but IMO I don't think that the phrase 'a list of expressions' is exactly the right term for this. That (to me) implies that we are wrapping the whole body in a list, which you don't. For example - ; What that phrase implies to me: (pcase-let ((a 1)) ((incf a) a)) But I have no idea how to better phrase this. For certain, though, they ought to match because they both behave the same way. ----- --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-docstring-of-pcase-let.patch Content-Description: Fix docstring of pcase-let* to accurately reflect what BODY can be >From c41219fcbbb01b5a219733ac54ad2cade438513b Mon Sep 17 00:00:00 2001 From: Robert Cochran Date: Wed, 14 Sep 2016 15:52:29 -0700 Subject: [PATCH] Fix docstring of pcase-let* pcase-let*'s docstring could have been taken to mean that the BODY parameter can only be a single expression, but it can be any numbers of expressions. Fix it to be more accurate. * lisp/emacs-lisp/pcase.el (pcase-let*): Fix docstring to be more accurate about what the BODY parameter can be. --- lisp/emacs-lisp/pcase.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 0b8dddf..2d61642 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -261,7 +261,7 @@ pcase--let* ;;;###autoload (defmacro pcase-let* (bindings &rest body) "Like `let*' but where you can use `pcase' patterns for bindings. -BODY should be an expression, and BINDINGS should be a list of bindings +BODY should be a list of expressions, and BINDINGS should be a list of bindings of the form (PAT EXP)." (declare (indent 1) (debug ((&rest (pcase-PAT &optional form)) body))) -- 2.7.4 --=-=-= Content-Type: text/plain ----- HTH, -- ~Robert Cochran GPG Fingerprint - E778 2DD4 FEA6 6A68 6F26 AD2D E5C3 EB36 4886 8871 --=-=-=--