Arc Forumnew | comments | leaders | submitlogin
3 points by CatDancer 5683 days ago | link | parent

oh, you're storing the default value inside the hash table itself. It took me a while to figure out what you were doing.

If you store the default value outside of the table then it won't show up when we print out the table, look at its keys, iterate over its keys and values, call tablist on it etc.

For example, you could store all the table defaults in its own hash table, using the tables as the keys and the default values as the values of the table:

  (define table-defaults (make-hash-table 'weak))
This creates a hash table which compares keys by their identity with eq? and doesn't prevent them from being garbage collected. (http://download.plt-scheme.org/doc/372/html/mzscheme/mzschem...)