Function: hash-replace

hash-replace is a byte-compiled function defined in hasht.el.

Signature

(hash-replace VALUE KEY HASH-TABLE)

Documentation

Replace VALUE referenced by KEY, a string, in HASH-TABLE and return VALUE.

Do nothing and return nil if KEY or HASH-TABLE are of the wrong type. An error will occur if KEY is not found in HASH-TABLE.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hasht.el
(defun hash-replace (value key hash-table)
  "Replace VALUE referenced by KEY, a string, in HASH-TABLE and return VALUE.
Do nothing and return nil if KEY or HASH-TABLE are of the wrong type.
An error will occur if KEY is not found in HASH-TABLE."
  (when (and (hash-table-p hash-table)
	     (stringp key))
    (let ((key-sym (intern-soft key)))
	(if (gethash key-sym hash-table)
	    (puthash key-sym value hash-table)
	  (error "(hash-replace): `%s' key not found in hash table" key)))))