X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fbinaries%2Fmatex%2Fground.ml;h=7eebedb7d13e8fa810c4dc0eb867aa038362e474;hb=c992745a40b4ac8b6c5285bf9c5eff26c423f236;hp=91d85bc36443e1ac1d296abb486762cf14c69ca5;hpb=e9caa75be87bdbd68d8ca2d7291f623bec6b93aa;p=helm.git diff --git a/matita/components/binaries/matex/ground.ml b/matita/components/binaries/matex/ground.ml index 91d85bc36..7eebedb7d 100644 --- a/matita/components/binaries/matex/ground.ml +++ b/matita/components/binaries/matex/ground.ml @@ -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