diff options
author | 2003-04-16 22:19:15 +0000 | |
---|---|---|
committer | 2003-04-16 22:19:15 +0000 | |
commit | 391605f6195f92603ca960014db302dc79e6d24f (patch) | |
tree | 42a7c7dd1d5b20f46b0ec65751fecc24fa101cdd /lib/util.ml | |
parent | 49374be0e27c50a5e3b4733e4d53fd5228741f83 (diff) |
une fonction list_skipn qui zappe les n premiers elements d'une liste
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3930 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
-rw-r--r-- | lib/util.ml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml index 982546ca9..6d9cf16b3 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -291,6 +291,11 @@ let list_lastn n l = in if len < n then failwith "lastn" else aux len l +let rec list_skipn n l = match n,l with + | 0, _ -> l + | _, [] -> failwith "list_fromn" + | n, _::l -> list_skipn (pred n) l + let list_prefix_of prefl l = let rec prefrec = function | (h1::t1, h2::t2) -> h1 = h2 && prefrec (t1,t2) |