From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id E0FB2BB86 for ; Tue, 9 May 2006 15:26:37 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k49DQbAM028662 for ; Tue, 9 May 2006 15:26:37 +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 PAA29741 for ; Tue, 9 May 2006 15:26:36 +0200 (MET DST) Received: from net.univ-savoie.fr (net.univ-savoie.fr [193.48.120.75]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k49DQam7010326 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 9 May 2006 15:26:36 +0200 Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by net.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id k49DQUuL024368 ; Tue, 9 May 2006 15:26:30 +0200 Received: from [193.48.123.45] (d45.lama.univ-savoie.fr [193.48.123.45]) by post.bourget.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id k49DQLOM009436 ; Tue, 9 May 2006 15:26:22 +0200 Message-ID: <44609882.7090908@univ-savoie.fr> Date: Tue, 09 May 2006 15:26:26 +0200 From: Christophe Raffalli User-Agent: Mozilla Thunderbird 1.0.6-7.1.20060mdk (X11/20050322) X-Accept-Language: fr, en MIME-Version: 1.0 To: Samuel Mimram Cc: caml-list Subject: Re: [Caml-list] is this a bug ? References: <44609473.6030004@univ-savoie.fr> <446096F0.6000405@ens-lyon.org> In-Reply-To: <446096F0.6000405@ens-lyon.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-Miltered: at concorde with ID 4460988D.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4460988C.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 bug:01 bug:01 syntax:01 cheers:01 chablais:01 73376:01 univ-savoie:01 lama:01 wrote:01 caml-list:01 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 Samuel Mimram a écrit : > 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 > but the you should be allowed to write | ([a;_] when a = b) | ( [_;a] when a = b ) -> 2 but this results in a syntax error ... > This would justify the warning and explain the behaviour... > > Cheers, > > Samuel. -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature. The public key is stored on www.keyserver.net ---------------------------------------------