]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/components/binaries/matex/ground.ml
- matex: minor corrections to handle applications with many arguments
[helm.git] / matita / components / binaries / matex / ground.ml
index 91d85bc36443e1ac1d296abb486762cf14c69ca5..7eebedb7d13e8fa810c4dc0eb867aa038362e474 100644 (file)
@@ -56,6 +56,13 @@ let rec rev_map_append map l r = match l with
    | []       -> r
    | hd :: tl -> rev_map_append map tl (map hd :: r)
 
+let rec split_at x = function
+   | l when x <= 0 -> [], l
+   | []       -> [], []
+   | hd :: tl -> 
+      let l1, l2 = split_at (pred x) tl in
+      hd :: l1, l2
+
 let error s = raise (Error s)
 
 let log s = P.eprintf "MaTeX: %s\n%!" s