Revert --map to using mapcar

Code in the wild relies on mapcar for working with non-list
sequences, and mapcar can still be faster in some degenerate cases.

* dash.el (--map): Use mapcar again.

Fixes #365.
master
Basil L. Contovounesios 5 years ago
parent 2625bc526b
commit 7583e6511b
No known key found for this signature in database
GPG Key ID: 205AB54A5D5D8CFF
  1. 9
      dash.el

@ -207,14 +207,7 @@ Each element of LIST in turn is bound to `it' before evaluating
BODY.
This is the anaphoric counterpart to `-map'."
(declare (debug (form form)))
(let ((l (make-symbol "list"))
(r (make-symbol "res")))
`(let ((,l ,list) ,r it)
(ignore it)
(while ,l
(setq it (pop ,l))
(push ,form ,r))
(nreverse ,r))))
`(mapcar (lambda (it) (ignore it) ,form) ,list))
(defmacro --reduce-from (form init list)
"Accumulate a value by evaluating FORM across LIST.

Loading…
Cancel
Save