1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 14:30:43 -08:00

Better syntax for the map pcase pattern

* lisp/emacs-lisp/map.el: Improves the map pcase pattern to take
bindings of the form (KEY PAT) or SYMBOL. KEY is not quoted.
This commit is contained in:
Nicolas Petton 2015-06-06 01:50:32 +02:00
parent cd22663b85
commit 2a54e8dfff

View file

@ -360,7 +360,7 @@ If KEY is not found, return DEFAULT which defaults to nil."
"Return a list of pcase bindings from ARGS to the elements of a map."
(seq-map (lambda (elt)
(if (consp elt)
`(app (pcase--flip map-elt ',(car elt)) ,(cdr elt))
`(app (pcase--flip map-elt ,(car elt)) ,(cadr elt))
`(app (pcase--flip map-elt ',elt) ,elt)))
args))