Function: map-contains-key
map-contains-key is a byte-compiled function defined in map.el.gz.
Signature
(map-contains-key MAP KEY &optional TESTFN)
Documentation
Return non-nil if and only if MAP contains KEY.
TESTFN is deprecated. Its default depends on MAP.
The default implementation delegates to map-some.
Probably introduced at or before Emacs version 27.1.
Implementations
((map hash-table) key &optional testfn) in `map.el'.
Return non-nil if MAP contains KEY, ignoring TESTFN.
((map array) key &optional testfn) in `map.el'.
Return non-nil if KEY is an index of MAP, ignoring TESTFN.
((map list) key &optional testfn) in `map.el'.
Return non-nil if MAP contains KEY. If MAP is an alist, TESTFN defaults to `equal'. If MAP is a plist, `plist-member' is used instead.
(map key &optional testfn) in `map.el'.
Undocumented
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/map.el.gz
(cl-defgeneric map-contains-key (map key &optional testfn)
;; FIXME: The test function to use generally depends on the map object,
;; so specifying `testfn' here is problematic: e.g. for hash-tables
;; we shouldn't use `gethash' unless `testfn' is the same as the map's own
;; test function!
"Return non-nil if and only if MAP contains KEY.
TESTFN is deprecated. Its default depends on MAP.
The default implementation delegates to `map-some'."
(unless testfn (setq testfn #'equal))
(map-some (lambda (k _v) (funcall testfn key k)) map))