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 4D2FCBB91 for ; Thu, 27 Jan 2005 13:20:36 +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 j0RCKZ72015176 for ; Thu, 27 Jan 2005 13:20:36 +0100 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 NAA21679 for ; Thu, 27 Jan 2005 13:20:35 +0100 (MET) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0RCKYrg023560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 27 Jan 2005 13:20:35 +0100 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from einhorn.in-berlin.de (localhost [127.0.0.1]) by einhorn.in-berlin.de (8.12.10/8.12.10/Debian-4) with ESMTP id j0RCKYF3020904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 27 Jan 2005 13:20:34 +0100 Received: (from www-data@localhost) by einhorn.in-berlin.de (8.12.10/8.12.10/Debian-4) id j0RCKYbG020902 for caml-list@inria.fr; Thu, 27 Jan 2005 13:20:34 +0100 X-Authentication-Warning: einhorn.in-berlin.de: www-data set sender to oliver@first.in-berlin.de using -f Received: from dialin-145-254-064-150.arcor-ip.net (dialin-145-254-064-150.arcor-ip.net [145.254.64.150]) by webmail.in-berlin.de (IMP) with HTTP for ; Thu, 27 Jan 2005 13:20:34 +0100 Message-ID: <1106828434.41f8dc9213b6e@webmail.in-berlin.de> Date: Thu, 27 Jan 2005 13:20:34 +0100 From: Oliver Bandel To: caml-list@inria.fr Subject: Strange matching-problem... ?! MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.2 X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 127.0.0.1 X-Miltered: at concorde with ID 41F8DC93.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41F8DC92.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; oliver:01 bandel:01 oliver:01 in-berlin:01 foobar:01 foo:01 foobar:01 foo:01 syntax:01 syntax:01 ocaml:01 ...:98 complains:01 defining:01 behaviour:01 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: Hello, any idea about this?! # type foobar = Foo | Bar;; type foobar = Foo | Bar # match Foo with Foo -> "foo" | Bar -> "bar";; - : string = "foo" # match Foo with _Foo -> "foo" |Bar -> "bar";; Warning: this match case is unused. - : string = "foo" # match Foo with _ Foo -> "foo" | Bar -> "bar";; Syntax error # 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. Using such things like _Foo instead of Foo does not yield any error message, but when defining the type with _Foo then ocaml complains about my wrong syntax. What's going on here and why? TIA, Oliver