all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Chunyang Xu <xuchunyang.me@gmail.com>
Cc: 24362-done@debbugs.gnu.org
Subject: bug#24362: 25.1.50; Inconsistent docstring between pcase-let and pcase-let*
Date: Fri, 08 Nov 2019 04:43:45 +0100	[thread overview]
Message-ID: <87a797vxqm.fsf@marxist.se> (raw)
In-Reply-To: <m2wpisxpcy.fsf@gmail.com> (Chunyang Xu's message of "Sun, 04 Sep 2016 12:26:05 +0800")

Chunyang Xu <xuchunyang.me@gmail.com> 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
>
> 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 has been changed on current master to:

    Like ‘let*’, but supports destructuring BINDINGS using ‘pcase’ patterns.
    As with ‘pcase-let’, BINDINGS are of the form (PATTERN EXP), but the
    EXP in each binding in BINDINGS can use the results of the destructuring
    bindings that precede it in BINDINGS’ order.
    
    Each EXP should match (i.e. be of compatible structure) to its
    respective PATTERN; a mismatch may signal an error or may go
    undetected, binding variables to arbitrary values, such as nil.

I'm therefore going to assume that the above is no longer an issue and
close this bug report.  If that is incorrect, please reopen.

Best regards,
Stefan Kangas





      parent reply	other threads:[~2019-11-08  3:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-04  4:26 bug#24362: 25.1.50; Inconsistent docstring between pcase-let and pcase-let* Chunyang Xu
2016-09-14 23:06 ` Robert Cochran
2016-09-15 21:36   ` Michael Heerdegen
2016-09-15 21:57     ` Robert Cochran
2016-09-15 22:00     ` Drew Adams
2016-09-15 22:40       ` Michael Heerdegen
2016-09-23 16:26   ` Michael Heerdegen
2016-09-23 20:45     ` Robert Cochran
2016-09-25 14:32       ` Michael Heerdegen
2016-09-26 23:39         ` Robert Cochran
2019-11-08  3:43 ` Stefan Kangas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a797vxqm.fsf@marxist.se \
    --to=stefan@marxist.se \
    --cc=24362-done@debbugs.gnu.org \
    --cc=xuchunyang.me@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.