Function: map--pcase-macroexpander

map--pcase-macroexpander is a function defined in map.el.gz.

Signature

(map--pcase-macroexpander &rest ARGS)

Documentation

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 with the KEY.

Each element can also be a SYMBOL, which is an abbreviation of a (KEY PAT) tuple of the form ('SYMBOL SYMBOL). When SYMBOL is a keyword, it is an abbreviation of the form (:SYMBOL SYMBOL), useful for binding plist values.

Keys in ARGS not found in the map are ignored, and the match doesn't fail.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/map.el.gz
;; Closure converted to defun by helpful.
(defun map--pcase-macroexpander
    (&rest args)
  "Build a `pcase' pattern matching map elements.\n\nARGS is a list of elements to be matched in the map.\n\nEach element of ARGS can be of the form (KEY PAT), in which case KEY is\nevaluated and searched for in the map.  The match fails if for any KEY\nfound in the map, the corresponding PAT doesn't match the value\nassociated with the KEY.\n\nEach element can also be a SYMBOL, which is an abbreviation of\na (KEY PAT) tuple of the form (\\='SYMBOL SYMBOL).  When SYMBOL\nis a keyword, it is an abbreviation of the form (:SYMBOL SYMBOL),\nuseful for binding plist values.\n\nKeys in ARGS not found in the map are ignored, and the match doesn't\nfail."
  `(and
    (pred mapp)
    ,@(map--make-pcase-bindings args)))