Function: dash--match-cons-1
dash--match-cons-1 is a byte-compiled function defined in dash.el.
Signature
(dash--match-cons-1 MATCH-FORM SOURCE &optional PROPS)
Documentation
Match MATCH-FORM against SOURCE.
MATCH-FORM is a proper or improper list. Each element of MATCH-FORM is either a symbol, which gets bound to the respective value in source or another match form which gets destructured recursively.
If the cdr of last cons cell in the list is nil, matching stops there.
SOURCE is a proper or improper list.
Source Code
;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun dash--match-cons-1 (match-form source &optional props)
"Match MATCH-FORM against SOURCE.
MATCH-FORM is a proper or improper list. Each element of
MATCH-FORM is either a symbol, which gets bound to the respective
value in source or another match form which gets destructured
recursively.
If the cdr of last cons cell in the list is nil, matching stops
there.
SOURCE is a proper or improper list."
(let ((skip-cdr (or (plist-get props :skip-cdr) 0)))
(cond
((consp match-form)
(cond
((cdr match-form)
(cond
((and (symbolp (car match-form))
(functionp (dash--get-expand-function (car match-form))))
(dash--match-kv (dash--match-kv-normalize-match-form match-form) (dash--match-cons-get-cdr skip-cdr source)))
((dash--match-ignore-place-p (car match-form))
(dash--match-cons-1 (cdr match-form) source
(plist-put props :skip-cdr (1+ skip-cdr))))
(t
(-concat (dash--match (car match-form) (dash--match-cons-skip-cdr skip-cdr source))
(dash--match-cons-1 (cdr match-form) source)))))
(t ;; Last matching place, no need for shift
(dash--match (car match-form) (dash--match-cons-get-car skip-cdr source)))))
((eq match-form nil)
nil)
(t ;; Handle improper lists. Last matching place, no need for shift
(dash--match match-form (dash--match-cons-get-cdr skip-cdr source))))))