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 92DEFBB84 for ; Tue, 9 May 2006 15:47:50 +0200 (CEST) Received: from arbi.Informatik.Uni-Oldenburg.DE (arbi.Informatik.Uni-Oldenburg.DE [134.106.1.7]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k49DloEw013449 for ; Tue, 9 May 2006 15:47:50 +0200 Received: from taifun.Informatik.Uni-Oldenburg.DE ([134.106.11.36]) by arbi.Informatik.Uni-Oldenburg.DE (Exim 3.36) id 1FdSZ3-0004HB-00; Tue, 09 May 2006 15:47:49 +0200 Received: from localhost ([134.106.11.44]) by taifun.Informatik.Uni-Oldenburg.DE (Exim 3.36) id 1FdSZ3-0000qI-00; Tue, 09 May 2006 15:47:49 +0200 From: Arne Ehrlich To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] is this a bug ? Date: Tue, 9 May 2006 15:47:46 +0200 User-Agent: KMail/1.9.1 References: <44609473.6030004@univ-savoie.fr> In-Reply-To: <44609473.6030004@univ-savoie.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605091547.47017.arne.ehrlich@groknet.de> X-Miltered: at nez-perce with ID 44609D86.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; arne:01 arne:01 bug:01 christophe:01 raffalli:01 bug:01 semantics:01 dienstag:98 2006:98 caml-list:01 int:01 int:01 newline:02 semantic:02 match:02 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 Am Dienstag, 9. Mai 2006 15:09 schrieb Christophe Raffalli: > hello, > > -------------------------------- > 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" ? You found an semantic problem in the gramar ^^ or-patterns do not play well with "when" I think it's a bug in the semantics...