]> matita.cs.unibo.it Git - helm.git/blobdiff - components/extlib/hExtlib.ml
BIG FAT COMMIT REGARDING COERCIONS:
[helm.git] / components / extlib / hExtlib.ml
index 3cc6c9bb5c0bc876f74d35de8868f3231a56c14e..c0364315a62c018923f2c9e76873a35087c15fd2 100644 (file)
@@ -180,6 +180,11 @@ let split_nth n l =
     | n, hd :: tl -> aux (hd :: acc) (n - 1) tl in
   aux [] n l
 
+let list_last l =
+  let l = List.rev l in 
+  try List.hd l with exn -> raise (Failure "HExtlib.list_last")
+;;
+  
 (** {2 File predicates} *)
 
 let is_dir fname =