Chez Scheme does allow for custom reading and writing of most records, including hashtables. Chez Scheme provides a record-writer
and record-reader
procedure which allow customizing the functions used to write and read records:
http://cisco.github.io/ChezScheme/csug9.5/objects.html#./objects:s176
There are some good examples on that page, but an important detail is that you can specify #f
as the writer, the default for new record types, which will use a format capable of being read back by the default reader. This won't work 100% of the time as there are some types which have no serializable representation, like functions.
Once I disable the special printer for eq-hashtables and the special printer for the base hashtables, I can see the default representation:
> (record-writer (record-rtd (make-eq-hashtable)) #f)
> (record-writer
(record-type-parent
(record-type-parent (record-rtd (make-eq-hashtable)))) #f)
> (make-eq-hashtable)
#[#{eq-ht icguu8mlhm1y7ywsairxck-0} eq #t #(0 1 2 3 4 5 6 7) 8 0 0]
> (define ht (make-eq-hashtable))
> (eq-hashtable-set! ht 'a "a")
> ht
#[#{eq-ht icguu8mlhm1y7ywsairxck-0} eq #t #(0 #<tlc> 2 3 4 5 6 7) 8 1 0]
Unfortunately, it looks like there's an object with a custom writer as part of the hashtable storage, so you can't use the default writer to see the entries.