]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/extlib/hExtlib.ml
added skip function
[helm.git] / helm / software / components / extlib / hExtlib.ml
index 0d19524dcf1842d2667f36de5286b7adfdfb8ba0..6af86f9cd4d4ac0b620d004976ea6a83fc951a6e 100644 (file)
@@ -515,3 +515,24 @@ let chop_prefix prefix s =
 let touch s =
   try close_out(open_out s) with Sys_error _ -> ()
 ;;
+
+let rec mk_list x = function
+  | 0 -> []
+  | n -> x :: mk_list x (n-1)
+;;
+
+let list_seq start stop =
+  let rec aux pos =
+    if pos = stop then []
+    else pos :: (aux (pos+1))
+  in
+    aux start
+;;
+
+let rec list_skip n l =
+  match n,l with
+  | 0,_ -> l
+  | n,_::l -> list_skip (n-1) l
+  | _, [] -> assert false
+;;
+