Function: map-do
map-do is a byte-compiled function defined in map.el.gz.
Signature
(map-do FUNCTION MAP)
Documentation
Apply FUNCTION to each element of MAP and return nil.
FUNCTION is called with two arguments, the key and the value of each MAP's element.
Other relevant functions are documented in the map group.
Shortdoc
;; map
(let ((map (list '(1 . 1) '(2 . 3)))
acc)
(map-do (lambda (k v) (push (+ k v) acc)) map)
(nreverse acc))
=> (2 5)
Implementations
(map-do FUNCTION (MAP array)) in `map.el'.
Implementation of `map-do' for maps that are arrays. In a map that is an array, the keys are the slot indices, and slot contents are the values. FUNCTION's arguments are the index of the element and the element itself.
(map-do FUNCTION (MAP list)) in `map.el'.
Implementation of `map-do' for maps that are plists or alists. In a map that is a plist, property names are the keys, and the corresponding property values are the values of those keys. In a map that is an alist, the `car' of each cons cell is the key and the `cdr' is the value. FUNCTION's arguments are property name and property value for plist elements, `car' and `cdr' of association cons cell for alists.
(map-do FUNCTION (MAP hash-table)) in `map.el'.
Implementation of `map-do' for maps that are hash-tables. Calls `maphash', which will call FUNCTION with key and value of each element of MAP.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/map.el.gz
(cl-defgeneric map-do (function map)
"Apply FUNCTION to each element of MAP and return nil.
FUNCTION is called with two arguments, the key and the value
of each MAP's element.")