Function: hash-map

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

Signature

(hash-map FUNC HASH-TABLE)

Documentation

Return the list from calling FUNC on (<value> . <string-key>) in HASH-TABLE.

If FUNC is in '(cdr key second symbol-name), then return all <key>s as strings. If FUNC is in '(car value first symbol-value), then return all <value>s.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hasht.el
(defun hash-map (func hash-table)
  "Return the list from calling FUNC on (<value> . <string-key>) in HASH-TABLE.

If FUNC is in \\='(cdr key second `symbol-name'), then return all <key>s
as strings.  If FUNC is in \\='(car value first `symbol-value'), then
return all <value>s."
  (unless (hash-table-p hash-table)
    (error "(hash-map): Invalid hash-table: `%s'" hash-table))
  (cond ((memq func '(cdr key second symbol-name))
	 (mapcar #'symbol-name (hash-table-keys hash-table)))
	((memq func '(car value first symbol-value))
	 (hash-table-values hash-table))
	(t (let ((result nil))
	     (maphash
	      (lambda (key value)
		(push (funcall func (cons value (symbol-name key)))
		      result))
	      hash-table)
	     (nreverse result)))))