GNU bug report logs - #71503
30.0.50; pcase-lambda (with "and" and "guard") does not work as expected

Previous Next

Package: emacs;

Reported by: Mekeor Melire <mekeor <at> posteo.de>

Date: Wed, 12 Jun 2024 08:42:01 UTC

Severity: normal

Found in version 30.0.50

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: mekeor <at> posteo.de, Eli Zaretskii <eliz <at> gnu.org>, 71503 <at> debbugs.gnu.org
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
>  (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





This bug report was last modified 1 year and 21 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.