Function: hash-prin1

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

Signature

(hash-prin1 HASH-TABLE &optional STREAM REVERSE)

Documentation

Output the printed representation of HASH-TABLE as a list.

Quoting characters are printed when needed to make output that read can handle, whenever this is possible. Output stream is optional STREAM, or the value of standard-output. With optional REVERSE non-nil, print each element with its key and value in reverse order to that stored in the hash table.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hasht.el
(defun hash-prin1 (hash-table &optional stream reverse)
  "Output the printed representation of HASH-TABLE as a list.
Quoting characters are printed when needed to make output that `read'
can handle, whenever this is possible.
Output stream is optional STREAM, or the value of `standard-output'.
With optional REVERSE non-nil, print each element with its key and
value in reverse order to that stored in the hash table."
  (if (not (hash-table-p hash-table))
      (progn (prin1 hash-table stream)
	     (princ "\n" stream))
    (princ "\(\n" stream)
    (if reverse
	(hash-map
	 (lambda (val-key-cons)
	   (prin1 (cons (cdr val-key-cons) (car val-key-cons)) stream)
	   (princ "\n" stream))
	 hash-table)
      (hash-map
       (lambda (val-key-cons)
	 (prin1 val-key-cons stream)
	 (princ "\n" stream))
       hash-table))
    (princ "\)\n" stream)))