From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 13EEE7EE7C for ; Wed, 27 Apr 2016 11:22:36 +0200 (CEST) IronPort-PHdr: 9a23:EhX4wxySpP8hoNjXCy+O+j09IxM/srCxBDY+r6Qd0ekUIJqq85mqBkHD//Il1AaPBtWLraIcwLON7ujJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6CyZTvnLnpptX6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD86Fpy8kVWqz/e+E8TKdEJDUgKWE8osPx5jfZSg7a2XoYVmQfl1IcGU6exBX7VJrrrjrhq/BznieAa56lBYsoUCivuv84ACTjjz0KYmY0 Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=r.3@libertysurf.fr; spf=None smtp.mailfrom=r.3@libertysurf.fr; spf=None smtp.helo=postmaster@smtp2-g21.free.fr Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of r.3@libertysurf.fr) identity=pra; client-ip=212.27.42.2; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="r.3@libertysurf.fr"; x-sender="r.3@libertysurf.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of r.3@libertysurf.fr) identity=mailfrom; client-ip=212.27.42.2; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="r.3@libertysurf.fr"; x-sender="r.3@libertysurf.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp2-g21.free.fr) identity=helo; client-ip=212.27.42.2; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="r.3@libertysurf.fr"; x-sender="postmaster@smtp2-g21.free.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AdAQCHhCBXjwIqG9Reql8BBoFVkkaBdIdJOhIBAQEBAQEBAREBAQEBBwsLCSEvQQ4BgV2CPgQRQDYCBRYEBwILAwIBAgFYCAKIJgSjZY9dkWF8hF2EEYYLgjSCVgWYEIIajyiGD4VXjzAnCoFnAQEBBwEBAQEBUSCBN4Yhg3cBAQE X-IPAS-Result: A0AdAQCHhCBXjwIqG9Reql8BBoFVkkaBdIdJOhIBAQEBAQEBAREBAQEBBwsLCSEvQQ4BgV2CPgQRQDYCBRYEBwILAwIBAgFYCAKIJgSjZY9dkWF8hF2EEYYLgjSCVgWYEIIajyiGD4VXjzAnCoFnAQEBBwEBAQEBUSCBN4Yhg3cBAQE X-IronPort-AV: E=Sophos;i="5.24,540,1454972400"; d="scan'208";a="175922468" Received: from smtp2-g21.free.fr ([212.27.42.2]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2016 11:22:22 +0200 Received: from [172.16.79.17] (unknown [143.196.127.2]) (Authenticated sender: r.3) by smtp2-g21.free.fr (Postfix) with ESMTPSA id 2E66E200389 for ; Wed, 27 Apr 2016 09:11:49 +0200 (CEST) To: caml-list@inria.fr From: William Message-ID: <572084CC.1080408@libertysurf.fr> Date: Wed, 27 Apr 2016 11:22:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Caml-list] ocaml 4.03 and warning 52 : argument of this constructor should not be matched against a constant pattern 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