4c3588fc |
(in-package :cl-user)
|
55a11d3d |
(defvar *old-pprint-dispatch* *print-pprint-dispatch*)
|
4c3588fc |
(setf *print-pprint-dispatch*
(copy-pprint-dispatch *old-pprint-dispatch*))
(defun pprint-hashtable (s hash-table)
(pprint-logical-block (s nil)
|
55a11d3d |
(princ "#<hash-table" s)
|
4c3588fc |
(let ((v (fset:convert 'list (fset:convert 'fset:map hash-table))))
(when v
(pprint-logical-block (s v)
(pprint-indent :block 0 s)
(loop do
(destructuring-bind (key . value) (pprint-pop)
|
55a11d3d |
(format s " ~s: ~s" key value)
|
4c3588fc |
(pprint-exit-if-list-exhausted)
(princ ", " s)
(pprint-newline :mandatory s))))))
(princ #\> s)))
(set-pprint-dispatch 'hash-table 'pprint-hashtable)
|