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 E7C7ABB91 for ; Sun, 23 Jan 2005 22:11:13 +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 j0NLBDrM005384 for ; Sun, 23 Jan 2005 22:11:13 +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 WAA08617 for ; Sun, 23 Jan 2005 22:11:13 +0100 (MET) Received: from furbychan.cocan.org (use.the.admin.shell.to.set.your.reverse.dns.for.this.ip [80.68.91.176] (may be forged)) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j0NLBCew005379 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 23 Jan 2005 22:11:13 +0100 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1Csp0q-000433-00 for ; Sun, 23 Jan 2005 21:11:12 +0000 Date: Sun, 23 Jan 2005 21:11:12 +0000 To: caml-list@inria.fr Subject: Strange syntax error Message-ID: <20050123211112.GA14067@furbychan.cocan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i From: Richard Jones X-Miltered: at concorde with ID 41F412F1.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41F412F0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; syntax:01 failwith:01 syntax:01 failwith:01 ocaml:01 parsing:01 bug:01 compiles:01 string:03 string:03 float:03 float:03 let:03 let:03 character:03 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: The following compiles fine: type t = { keyword : string; cost : float option; } let f = function | { keyword = keyword } when keyword.[0] = '-' -> keyword | { keyword = keyword; cost = None } -> keyword | _ -> failwith "whatever" But this, which surely is equivalent, fails with a syntax error at the second '|' character: type t = { keyword : string; cost : float option; } let f = function | { keyword = keyword } when keyword.[0] = '-' (* -> keyword *) | { keyword = keyword; cost = None } -> keyword | _ -> failwith "whatever" OCaml 3.08.1. Is this a parsing bug? Rich. --