Function: map--make-pcase-bindings

map--make-pcase-bindings is a byte-compiled function defined in map.el.gz.

Signature

(map--make-pcase-bindings ARGS)

Documentation

Return a list of pcase bindings from ARGS to the elements of a map.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/map.el.gz
(defun map--make-pcase-bindings (args)
  "Return a list of pcase bindings from ARGS to the elements of a map."
  (mapcar (lambda (elt)
            (cond ((consp elt)
                   `(app (pcase--flip map-elt ,(car elt)) ,(cadr elt)))
                  ((keywordp elt)
                   (let ((var (intern (substring (symbol-name elt) 1))))
                     `(app (pcase--flip map-elt ,elt) ,var)))
                  (t `(app (pcase--flip map-elt ',elt) ,elt))))
          args))