--- Begin Message ---
Subject: |
25.1.50; Inconsistent docstring between pcase-let and pcase-let* |
Date: |
Sun, 04 Sep 2016 12:26:05 +0800 |
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).
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#24362: 25.1.50; Inconsistent docstring between pcase-let and pcase-let* |
Date: |
Fri, 08 Nov 2019 04:43:45 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Chunyang Xu <address@hidden> 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
--- End Message ---