Function: map-copy
map-copy is a byte-compiled function defined in map.el.gz.
Signature
(map-copy MAP)
Documentation
Return a copy of MAP.
Other relevant functions are documented in the map group.
Probably introduced at or before Emacs version 28.1.
Shortdoc
;; map
(map-copy (list 'bar 1 'foo 2 'baz 3))
=> (bar 1 foo 2 baz 3)
(map-copy (list '(bar . 1) '(foo . 2) '(baz . 3)))
=> ((bar . 1) (foo . 2) (baz . 3))
(map-copy [bar foo baz])
=> [bar foo baz]
(map-copy #s(hash-table data (bar 1 foo 2 baz 3)))
=> #s(hash-table data (bar 1 foo 2 baz 3))
Implementations
(map-copy (MAP array)) in `map.el'.
Implementation of `map-copy' for maps that are arrays. In a map that is an array, the keys are the slot indices, and slot contents are the values. Uses `copy-sequence'.
(map-copy (MAP hash-table)) in `map.el'.
Implementation of `map-copy' for maps that are hash-tables. Returns a copy of MAP produced by `copy-hash-table'.
(map-copy (MAP list)) in `map.el'.
Implementation of `map-copy' for maps that are plists or alists. Uses `copy-alist' on alists and `copy-sequence' on plists.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/map.el.gz
(cl-defgeneric map-copy (map)
"Return a copy of MAP.")