1 type uri = int * string (* shareno, URI *)
3 let string_of_uri (_, uri) = uri;;
5 module OrderedStrings =
8 let compare (s1 : t) (s2 : t) = compare s1 s2
12 module MapStringsToUri = Map.Make(OrderedStrings);;
14 let set_of_uri = ref MapStringsToUri.empty;;
17 let counter = ref 0 in
18 let c () = incr counter; !counter in
20 try MapStringsToUri.find s !set_of_uri
22 let new_uri = c(), s in
23 set_of_uri := MapStringsToUri.add s new_uri !set_of_uri;
28 let compare (n1,_) (n2,_) = n2 - n1;;
37 module UriHash = Hashtbl.Make(HT);;