Subject: Re: bug#24362: 25.1.50; Inconsistent docstring between pcase-let and pcase-let*
From: Stefan Kangas <[email-masked]>
To: Chunyang Xu <[email-masked]>
Cc: [email-masked]
Date: Fri, 08 Nov 2019 04:43:45 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Chunyang Xu <[email-masked]> 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