[plt-scheme] readable hash tables?

From: Chongkai Zhu (u0476504 at utah.edu)
Date: Tue Sep 5 22:05:52 EDT 2006

When the print-hash-table parameter is set to true (see section 7.9.1.4), hash tables print using the form #hash((key . val) ...) or #hasheq((key . val) ...) for tables using equal? or eq? key comparisons, respectively. If the print-hash-table parameter's value is #f, hash tables print unreadably as #<hash-table>. Hash tables with weakly held keys always print unreadably as #<hash-table>.


Expressions of the form #hash((key-datum . val-datum) ...) are literal immutable hash tables. The hash table maps each key-datum to its val-datum, comparing keys with equal?. The table is constructed by adding each key-datum mapping from left to right, so later mappings can hide earlier mappings if the key-datums are equal?. An expression of the form #hasheq((key-datum . val-datum) ...) produces an immutable hash table with keys compared using eq?. If the value of read-square-bracket-as-paren parameter (see section 7.9.1.3) is true, matching parentheses in a #hash or #hasheq constant can be replaced by matching square brackets. Similarly, matching curly braces can be used if read-curly-brace-as-paren is true.


----- Original Message ----- 
From: "Paul Graham" <pg at ycombinator.com>
To: <plt-scheme at list.cs.brown.edu>
Sent: Tuesday, September 05, 2006 7:53 PM
Subject: [plt-scheme] readable hash tables?


> Is there any provision in metropolitan mzscheme for writing
> hash tables in a way that they can be read back in by read?
> 
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>

Posted on the users mailing list.