Hashtables

Grzegorz Chrupała grzegorz at pithekos.net
Tue Oct 12 16:44:17 CEST 2004


On Tue 12 Oct 2004 15:38, duchier at ps.uni-sb.de wrote:
> > {Dictionary.put MyDictionary
> >                 {StringToAtom {ByteString.toString {Pickle.pack
> > MyRec}}} MyValue}
>
> No.  It is not a guaranteed invariant of Pickle.pack that it always
> returns the same sequence of bytes.  It is only guaranteed that
> unpacking this sequence will reconstruct a value that cannot be
> distinguished from the original.
Too bad.
>
> Instead, you should define a sensible hash function and build a
> hashtable abstraction on top of dictionaries.  I wrote something like
> that in the past, but I don't know where I put the code, sorry :-(

Wouldn't it make sense to have such hashtables included in the standard 
Mozart distribution? I for one would find is very useful. An item for 
the Mozart wishlist (if there is one).

-- 
Grzegorz Chrupała





More information about the mozart-users mailing list