Function: --zip-with
--zip-with is a macro defined in dash.el.
Signature
(--zip-with FORM LIST1 LIST2)
Documentation
Zip LIST1 and LIST2 into a new list according to FORM.
That is, evaluate FORM for each item pair from the two lists, and return the list of results. The result is as long as the shorter list.
Each element of LIST1 and each element of LIST2 in turn are bound
pairwise to it and other, respectively, and their index
within the list to it-index, before evaluating FORM.
This is the anaphoric counterpart to -zip-with.
Source Code
;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defmacro --zip-with (form list1 list2)
"Zip LIST1 and LIST2 into a new list according to FORM.
That is, evaluate FORM for each item pair from the two lists, and
return the list of results. The result is as long as the shorter
list.
Each element of LIST1 and each element of LIST2 in turn are bound
pairwise to `it' and `other', respectively, and their index
within the list to `it-index', before evaluating FORM.
This is the anaphoric counterpart to `-zip-with'."
(declare (debug (form form form)))
(let ((r (make-symbol "result"))
(l2 (make-symbol "list2")))
`(let ((,l2 ,list2) ,r)
(--each-while ,list1 ,l2
(let ((other (pop ,l2)))
(ignore other)
(push ,form ,r)))
(nreverse ,r))))