bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work


From: Stefan Monnier
Subject: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected
Date: Sat, 20 Jul 2024 10:06:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

>  (defmacro pcase-lambda (lambda-list &rest body)
>    "Like `lambda' but allow each argument to be a pattern.
> -I.e. accepts the usual &optional and &rest keywords, but every
> -formal argument can be any pattern accepted by `pcase' (a mere
> -variable name being but a special case of it)."
> +I.e. accepts the usual &optional and &rest keywords, but every formal
> +argument can be any pattern accepted by `pcase' (a mere variable name
> +being but a special case of it).  Keep in mind that BODY is always
> +evaluated, regardless of whether the argument-patterns match or not."
>    (declare (doc-string 2) (indent defun)
>             (debug (&define (&rest pcase-PAT) lambda-doc def-body)))
>    (let* ((bindings ())

I tend to call "any pattern accepted by `pcase'" a "Pcase pattern".
More importantly, we should refer to `pcase-let` rather than to
`pcase` here and we should likely use the term "destructuring (binding)".


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]