From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 62414BB84 for ; Tue, 9 May 2006 15:19:49 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k49DJm1x009255 for ; Tue, 9 May 2006 15:19:49 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA29855 for ; Tue, 9 May 2006 15:19:48 +0200 (MET DST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k49DJm89009248 for ; Tue, 9 May 2006 15:19:48 +0200 Received: from hydrogene.pps.jussieu.fr (hydrogene.pps.jussieu.fr [134.157.168.1]) by shiva.jussieu.fr (8.13.6/jtpda-5.4) with ESMTP id k49DJj7a044978 ; Tue, 9 May 2006 15:19:45 +0200 (CEST) X-Ids: 165 Received: from [134.157.168.58] (cerium.pps.jussieu.fr [134.157.168.58]) by hydrogene.pps.jussieu.fr (8.13.4/jtpda-5.4) with ESMTP id k49DJiLj015719 ; Tue, 9 May 2006 15:19:44 +0200 Message-ID: <446096F0.6000405@ens-lyon.org> Date: Tue, 09 May 2006 15:19:44 +0200 From: Samuel Mimram User-Agent: Thunderbird 1.5.0.2 (X11/20060501) MIME-Version: 1.0 To: Christophe Raffalli Cc: caml-list Subject: Re: [Caml-list] is this a bug ? References: <44609473.6030004@univ-savoie.fr> In-Reply-To: <44609473.6030004@univ-savoie.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.7.2 (shiva.jussieu.fr [134.157.0.165]); Tue, 09 May 2006 15:19:46 +0200 (CEST) X-Antivirus: scanned by sophie at shiva.jussieu.fr X-Miltered: at nez-perce with ID 446096F4.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 446096F4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at shiva.jussieu.fr with ID 446096F1.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ens-lyon:01 bug:01 christophe:01 raffalli:01 bug:01 cheers:01 wrote:01 caml-list:01 behaviour:01 int:01 int:01 newline:02 match:02 guess:03 pattern:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Hi, Christophe Raffalli wrote: > -------------------------------- > let f b l = match l with > [] | [_] -> 1 > | [a;_] | [_;a] when a = b-> 2 > | _ -> 3 > > let _ = > print_int (f 1 [1;2]); > print_int (f 1 [2;1]); > print_newline () > -------------------------------- > > Do you think this code should have a useless pattern warning and print > "23" instead of "22" ? > > If someone tell me this is a bug then I fill a bug report ... I guess that the priorities says that you should "read" the third line as | [a;_] | ( [_;a] when a = b ) -> 2 This would justify the warning and explain the behaviour... Cheers, Samuel.