On 28/07/11 15:18, Xavier Leroy wrote: > Fabrice Le Fessant <[email protected]>: > >> Thus, you should consider using your own hash function, probably only >> considering the ints in the list and its length. Then, use the functor >> in the Hashtbl module. > > On 07/28/2011 02:25 PM, [email protected] wrote: > >> You could also use the hash_param : int -> int -> 'a -> int >> function in the functor which allows to specify the number >> of nodes traversed to compute the key : > > Both Fabrice's and Nicolas's suggestions are excellent. > > Let me just add that this problem with lists as hashtable keys is one > of the known issues with OCaml's current generic hash function: the > other is that the mixing functions used are simplistic and exhibit > some statistical bias, even for strings.
I will try both suggestions and look at the SVN trunk. Let me just add that the lists being hashed are all of length 5, so the length should not be the issue. Hopefully 3.13 will fix this problem. Thanks everyone for the useful suggestions, Toby -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
