From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id DD1F7BB91 for ; Thu, 27 Jan 2005 13:31:19 +0100 (CET) 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 j0RCVJIB016875 for ; Thu, 27 Jan 2005 13:31:19 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA22558 for ; Thu, 27 Jan 2005 13:31:19 +0100 (MET) Received: from decis.be ([194.78.219.157]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j0RCVIIr016863 for ; Thu, 27 Jan 2005 13:31:18 +0100 Received: from decis.be by decis.be (MDaemon.PRO.v7.2.2.R) with ESMTP id md50000208086.msg for ; Thu, 27 Jan 2005 13:31:02 +0100 Message-ID: <41F8DF9C.72F888C0@decis.be> Date: Thu, 27 Jan 2005 12:33:32 +0000 From: Frederic van der Plancke Organization: Decis X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en,fr-BE,fr MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Strange matching-problem... ?! References: <1106828434.41f8dc9213b6e@webmail.in-berlin.de> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Authenticated-Sender: fplancke@decis.be X-MDRemoteIP: 192.168.0.20 X-Return-Path: fvdp@decis.be X-MDaemon-Deliver-To: caml-list@inria.fr Reply-To: fvdp@decis.be X-Miltered: at concorde with ID 41F8DF17.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41F8DF16.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; plancke:01 caml-list:01 oliver:01 bandel:01 wrote:01 foo:01 foo:01 foobar:01 syntax:01 lowercase:01 ...:98 behaviour:01 match:02 match:02 string:03 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.9 required=5.0 tests=PLING_QUERY autolearn=disabled version=3.0.0 X-Spam-Level: Oliver Bandel wrote: > # match Foo with > _Bar -> "bar" > | Foo -> "foo";; > Warning: this match case is unused. > - : string = "bar" > > # type foobar2 = _Foo | Bar;; > Syntax error > # > > Why is the second match working without any error message? > Did I ovelooked something? > > I found that behaviour, after I tried to > use Sumtypes starting with an "_" in the name. Doesn't _ work as a lowercase letter ? Then _Foo and _Bar are not valid sum type tags, but they are valid variable names hence match Foo with _Bar -> "bar" | Foo -> "foo";; works exactly like match Foo with x -> "bar" | Foo -> "foo";; would. Frédéric