X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2FmatitaMisc.ml;h=094f965e0ae20d02aff1ae0130d82899b4d729a3;hb=b41886e9d21d756279bd6a2ec3f19c17b1a64401;hp=dd84abcbd00de0e7ffc32b60907f409a1158a029;hpb=7deafec4fd4b2eebf4d4061f21ee5c47bd15b062;p=helm.git diff --git a/helm/matita/matitaMisc.ml b/helm/matita/matitaMisc.ml index dd84abcbd..094f965e0 100644 --- a/helm/matita/matitaMisc.ml +++ b/helm/matita/matitaMisc.ml @@ -49,12 +49,13 @@ let strip_trailing_blanks = let rex = Pcre.regexp "\\s*$" in fun s -> Pcre.replace ~rex s -let empty_mathml = - let doc = - Misc.domImpl#createDocument ~namespaceURI:(Some Misc.mathml_ns) - ~qualifiedName:(Gdome.domString "math") ~doctype:None - in - doc#get_documentElement +let empty_mathml () = + Misc.domImpl#createDocument ~namespaceURI:(Some Misc.mathml_ns) + ~qualifiedName:(Gdome.domString "math") ~doctype:None + +let empty_boxml () = + Misc.domImpl#createDocument ~namespaceURI:(Some Misc.boxml_ns) + ~qualifiedName:(Gdome.domString "box") ~doctype:None exception History_failure @@ -140,3 +141,9 @@ let dbd_instance = in fun () -> Lazy.force dbd +let singleton f = + let instance = lazy (f ()) in + fun () -> Lazy.force instance + +let mkdirs = List.iter (fun d -> ignore (Unix.system ("mkdir -p " ^ d))) +