Quoting 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.
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 :
# let list = ref [];;
for i = 1 to 30 do
list := i :: !list;
Printf.printf "%d " (Hashtbl.hash_param 50 50 !list)
done ;;
1 65601 8392706 797307010 578301955 731304131 182476804 222011652
582000645 696017221 383840262 291574150 409554951 301052359 474071048
875971080 459423753 1026998857 314757130 771437194 56324107 59478731
841228300 921690892 921690892 841228300 59478731 56324107 771437194
314757130 - : unit = ()
-- Nicolas Barnier
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
--
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