Function: map-put

map-put is a macro defined in map.el.gz.

This macro is obsolete since 27.1; use map-put! or (setf (map-elt ...) ...) instead

Signature

(map-put MAP KEY VALUE &optional TESTFN)

Documentation

Associate KEY with VALUE in MAP and return VALUE.

If KEY is already present in MAP, replace the associated value with VALUE. When MAP is an alist, test equality with TESTFN if non-nil, otherwise use equal.

MAP can be an alist, plist, hash-table, or array.

Probably introduced at or before Emacs version 26.1.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/map.el.gz
(defmacro map-put (map key value &optional testfn)
  "Associate KEY with VALUE in MAP and return VALUE.
If KEY is already present in MAP, replace the associated value
with VALUE.
When MAP is an alist, test equality with TESTFN if non-nil,
otherwise use `equal'.

MAP can be an alist, plist, hash-table, or array."
  (declare (obsolete "use map-put! or (setf (map-elt ...) ...) instead" "27.1"))
  `(setf (map-elt ,map ,key nil ,testfn) ,value))