X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Finterface%2FuriManager.ml.implementazione_semplice;fp=helm%2Finterface%2FuriManager.ml.implementazione_semplice;h=0000000000000000000000000000000000000000;hb=c7514aaa249a96c5fdd39b1123fbdb38d92f20b6;hp=8b8921b3ebe8d82d7370e1677981172d668f79e0;hpb=1c7fb836e2af4f2f3d18afd0396701f2094265ff;p=helm.git diff --git a/helm/interface/uriManager.ml.implementazione_semplice b/helm/interface/uriManager.ml.implementazione_semplice deleted file mode 100644 index 8b8921b3e..000000000 --- a/helm/interface/uriManager.ml.implementazione_semplice +++ /dev/null @@ -1,39 +0,0 @@ -type uri = string;; - -let eq uri1 uri2 = - uri1 == uri2 -;; - -let string_of_uri uri = uri;; - -let name_of_uri uri = - let l = Str.split (Str.regexp "/") uri in - let name_suf = List.nth l (List.length l - 1) in - List.hd (Str.split (Str.regexp "\.") name_suf) -;; - -let depth_of_uri uri = - List.length (Str.split (Str.regexp "/") uri) - 2 -;; - -module OrderedStrings = - struct - type t = string - let compare (s1 : t) (s2 : t) = compare s1 s2 - end -;; - -module SetOfStrings = Map.Make(OrderedStrings);; - -(* Invariant: the map is the identity function, *) -(* i.e. (SetOfStrings.find str !set_of_uri) == str *) -let set_of_uri = ref SetOfStrings.empty;; - -let uri_of_string str = - try - SetOfStrings.find str !set_of_uri - with - Not_found -> - set_of_uri := SetOfStrings.add str str !set_of_uri ; - str -;;