Function: map-apply
map-apply is a byte-compiled function defined in map.el.gz.
Signature
(map-apply FUNCTION MAP)
Documentation
Apply FUNCTION to each element of MAP and return the result as a list.
FUNCTION is called with two arguments, the key of an element and its value.
The default implementation delegates to map-do.
Other relevant functions are documented in the map group.
Shortdoc
;; map
(map-apply #'+ (list '(1 . 2) '(3 . 4)))
=> (3 7)
Implementations
(map-apply FUNCTION (MAP array)) in `map.el'.
Undocumented
(map-apply FUNCTION (MAP hash-table)) in `map.el'.
Undocumented
(map-apply FUNCTION (MAP list)) in `map.el'.
Undocumented
(map-apply FUNCTION MAP) in `map.el'.
Undocumented
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/map.el.gz
(cl-defgeneric map-apply (function map)
"Apply FUNCTION to each element of MAP and return the result as a list.
FUNCTION is called with two arguments, the key of an element and its value.
The default implementation delegates to `map-do'."
(let ((res '()))
(map-do (lambda (k v) (push (funcall function k v) res)) map)
(nreverse res)))