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 [DEFAULT]), which looks up KEY in the map and matches the associated value against pcase pattern PAT. DEFAULT specifies the fallback value to use when KEY is not present in the map. If omitted, it defaults to nil. Both KEY and DEFAULT are evaluated.

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.

An element of ARGS fails to match if PAT does not match the associated value or the default value. The overall pattern fails to match if any element of ARGS fails to match.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/map.el.gz
;; Could not find source code, showing raw function object.
#[(&rest args) (`(and (pred mapp) ,@(map--make-pcase-bindings args)))
  (t) nil
  "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 [DEFAULT]),\nwhich looks up KEY in the map and matches the associated value\nagainst `pcase' pattern PAT.  DEFAULT specifies the fallback\nvalue to use when KEY is not present in the map.  If omitted, it\ndefaults to nil.  Both KEY and DEFAULT are evaluated.\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\nAn element of ARGS fails to match if PAT does not match the\nassociated value or the default value.  The overall pattern fails\nto match if any element of ARGS fails to match."]