]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitaMisc.ml
added choose_uri method to console, used by the interpreter to implement the
[helm.git] / helm / matita / matitaMisc.ml
index dd84abcbd00de0e7ffc32b60907f409a1158a029..094f965e0ae20d02aff1ae0130d82899b4d729a3 100644 (file)
@@ -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)))
+