emacs-devel
[Top][All Lists]
Advanced

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

Re: pcase map binding form expansion failure on Emacs 27 only


From: Adam Porter
Subject: Re: pcase map binding form expansion failure on Emacs 27 only
Date: Wed, 08 Sep 2021 00:43:53 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

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




reply via email to

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