Hello,
with ocaml 4.03, I came with many warnings such as this one :
let lst = [] in
try
let fst = List.hd lst in
Printf.printf "fst:%s\n" fst
with
| Failure "hd" -> Printf.printf "empty list\n";;
Characters 123-127:
| Failure "hd" -> Printf.printf "empty list\n";;
^^^^
Warning 52: the argument of this constructor should not be matched against a
constant pattern; the actual value of the argument could change
in the future.
It occurs typically for Failure "hd", Failure "tl", Failure "float_of_string", Failure "int_of_string", Failure "lexing: empty token", Invalid_argument "Filename.chop_extension", ...
How are we supposed to handle this nicely with the standard library ? Is there a better approach to catch those exceptions ?
Best regards,
William
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs