[plt-scheme] likely 3.99.0.22 -> 3.99.0.23 incompatibility: hash tables

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Apr 8 18:34:41 EDT 2008

This is now committed in the SVN trunk as v3.99.0.23.

Two more details:

 * `make-hash-table' has split into four functions: 

     - `make-hash' - an `equal?'-based table
     - `make-hasheq' - an `eq?'-based table
     - `make-weak-hash' - an `equal?'-based table with weakly held keys
     - `make-weak-hasheq' - an `eq?'-based table with weakly held keys

 * `hash-table?' similarly has split into three:

     - `hash?' - like `hash-table?' with no arguments
     - `hash-eq?' - reports whether a hash table uses `eq?' keys
     - `hash-weak?' - reports whether a hash table weakly holds keys

These changes get rid of the awkward 'equal and 'weak flags in the old
API. Although `hasheq' is a bit ugly, it's consistent with the
`#hasheq()' read/write syntax.

Matthew

At Tue, 8 Apr 2008 06:17:32 -0600, Matthew Flatt wrote:
> The new plan is a simpler version of the old one, using "hash" instead
> of "table":
> 
>  * Change `hash-table-get' to `hash-ref'.
> 
>  * Change hash-table-put!' to `hash-set!'.
> 
>  * Change "hash-table" in other function names to just "hash":
>    `hash-table-count' -> `hash-count'.
> 
>  * Add `hash-set' (no "!"), which takes an immutable hash table and
>    functionally produces an extended one. Note that `#hash()' and
>    `#hasheq()' become useful base cases for inductively building up a
>    table with `hash-set'.
> 
>  * Add `hash-remove', the functional complement of `hash-remove!'.
> 
>  * Add `for/hash', which builds an immutable hash table.
> 
> 
> And as a separate step:
> 
>  * Add a new `scheme/dict' library that provides `dict-ref', etc.
>    operations that abstract over the dictionary implementation, and
>    that can be extended to new datatypes using the `prop:dict'
>    structure-type property.
> 
> 
> Matthew
> 
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.