X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fextlib%2FhExtlib.ml;h=6af86f9cd4d4ac0b620d004976ea6a83fc951a6e;hb=abc5b4352a4ad787ede7122e2239ee44132886dd;hp=0d19524dcf1842d2667f36de5286b7adfdfb8ba0;hpb=dd5a5cfcb19e3ef5059dbb2d777a6f147dd556a6;p=helm.git diff --git a/helm/software/components/extlib/hExtlib.ml b/helm/software/components/extlib/hExtlib.ml index 0d19524dc..6af86f9cd 100644 --- a/helm/software/components/extlib/hExtlib.ml +++ b/helm/software/components/extlib/hExtlib.ml @@ -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 +;; +