[cl-store-devel] hash-table serialization with custom hashing functions

Sean Ross rosssd at gmail.com
Mon May 18 14:40:40 UTC 2009


On 21 Apr 2009, at 23:37, Chris Dean wrote:

>


Hi Chris,
   Sorry for the late reply, somehow this slipped through my net.


> How should I handle hash-tables with custom hashing functions?  Some
> Lisps have an extension to make-hash-table to allow for a custom  
> hashing
> function:
>
>  (make-hash-table :test 'my-equal :hash-function 'my-hashing)
>
> How should we handle serialization for these objects?  Right now we
> write out the hash-table-test but not the hash-function.  This causes
> bad behaviors (or an error) on some Lisps when I restore the hash- 
> table.
> The problem (as I see it) is that there is no standard way to get the
> hash-function.


Quite, although serializing the hash-function is what is really  
required here,

>
> I was about to try and convince the Clozure folks to add a
> hash-table-hash-function and then send a patch to cl-store that used
> that function for Clozure, when I realized what a bad idea that is.   
> I'd
> rather be able to fix this problem once for all CL implementations.
>
> So what do you think?  Should we add a registry of some sort so that  
> we
> know that restoring a hash-table with a hash-table-test of X should
> always use a hash-function of Y?


   I would be quite happy with the addition of extra information to  
hash table serialization provided
   we can come up with reasonable behaviour across the implementations  
which don't have a hashing function.



- sean



  
  




More information about the cl-store-devel mailing list