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: Kevin Vigouroux
Subject: Re: pcase map binding form expansion failure on Emacs 27 only
Date: Tue, 07 Sep 2021 18:44:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

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

-- 
Best regards,
Kevin Vigouroux



reply via email to

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