From: Adam Porter <adam@alphapapa.net>
To: emacs-devel@gnu.org
Subject: Re: pcase map binding form expansion failure on Emacs 27 only
Date: Wed, 08 Sep 2021 00:43:53 -0500 [thread overview]
Message-ID: <87a6kn62qu.fsf@alphapapa.net> (raw)
In-Reply-To: 87wnnsl4hw.fsf@laposte.net
Kevin Vigouroux via "Emacs development discussions."
<emacs-devel@gnu.org> writes:
> Hi Adam,
>
> Your pattern seems incorrect.
>
> #+begin_quote
> (map :max-width) ≈ (map (:max-width :max-width))
> #+end_quote
>
>
> :max-width is a keyword (pattern) but should be a symbol `max-width'.
>
> #+begin_quote
> -- (map &rest ARGS)
>
> Build a ‘pcase’ pattern matching map elements.
>
> ARGS is a list of elements to be matched in the map.
>
> Each element of ARGS can be of the form (KEY PAT), in which case KEY is
> evaluated and searched for in the map. The match fails if for any KEY
> found in the map, the corresponding PAT doesn’t match the value
> associated to the KEY.
>
> Each element can also be a SYMBOL, which is an abbreviation of a (KEY
> PAT) tuple of the form ('SYMBOL SYMBOL).
>
> Keys in ARGS not found in the map are ignored, and the match doesn’t
> fail.
> #+end_quote
>
> #+begin_src emacs-lisp
> (pcase-let* (((map (:max-width max-width)) plist))
> max-width)
> #+end_src
Please see:
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e287da5a8154d83a97107b64915ccc17e3a086b8
next prev parent reply other threads:[~2021-09-08 5:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 12:08 pcase map binding form expansion failure on Emacs 27 only Adam Porter
2021-09-07 16:44 ` Kevin Vigouroux via Emacs development discussions.
2021-09-07 23:49 ` Michael Heerdegen
2021-09-08 11:58 ` Kevin Vigouroux via Emacs development discussions.
2021-09-08 5:43 ` Adam Porter [this message]
2021-09-08 13:07 ` Kevin Vigouroux via Emacs development discussions.
2021-09-08 14:28 ` Adam Porter
2021-09-08 16:47 ` Kevin Vigouroux via Emacs development discussions.
2021-09-08 18:48 ` Adam Porter
2021-09-09 6:20 ` Kevin Vigouroux via Emacs development discussions.
2021-09-10 18:35 ` Kevin Vigouroux via Emacs development discussions.
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6kn62qu.fsf@alphapapa.net \
--to=adam@alphapapa.net \
--cc=emacs-devel@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).