Function: gethash
gethash is a function defined in fns.c.
Signature
(gethash KEY TABLE &optional DFLT)
Documentation
Look up KEY in TABLE and return its associated value.
If KEY is not found, return DFLT which defaults to nil.
Other relevant functions are documented in the hash-table group.
Probably introduced at or before Emacs version 21.1.
Shortdoc
;; hash-table
(gethash 'key table)
e.g. => "value"
Aliases
cl-gethash (obsolete since 24.3)
Source Code
// Defined in /usr/src/emacs/src/fns.c
{
struct Lisp_Hash_Table *h = check_hash_table (table);
ptrdiff_t i = hash_lookup (h, key, NULL);
return i >= 0 ? HASH_VALUE (h, i) : dflt;
}