]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/extlib/hExtlib.ml
added list_seq
[helm.git] / helm / software / components / extlib / hExtlib.ml
index 0d19524dcf1842d2667f36de5286b7adfdfb8ba0..fe0f417cdf88521a401a54d0ebbf41ba79ef0b58 100644 (file)
@@ -515,3 +515,17 @@ 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
+;;
+