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 889C8BC51 for ; Mon, 29 Nov 2004 17:43:47 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iATGhlfF020506 for ; Mon, 29 Nov 2004 17:43:47 +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 RAA01324 for ; Mon, 29 Nov 2004 17:43:46 +0100 (MET) Received: from alex.barettalocal.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iATGhkHW019044 for ; Mon, 29 Nov 2004 17:43:46 +0100 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by alex.barettalocal.com (Postfix) with ESMTP id 0A2E52BAA53; Mon, 29 Nov 2004 17:46:13 +0100 (CET) Message-ID: <41AB5254.6050004@barettadeit.com> Date: Mon, 29 Nov 2004 17:46:12 +0100 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5 X-Accept-Language: it, en-us, en MIME-Version: 1.0 To: Richard Jones Cc: caml-list@inria.fr Subject: Re: [Caml-list] Strange parsing of with-clauses References: <20041129162640.GA27030@annexia.org> In-Reply-To: <20041129162640.GA27030@annexia.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41AB51C3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41AB51C2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 caml-list:01 parsing:01 wrote:01 val:01 failwith:01 failwith:01 baretta:01 exception:01 exception:01 constructor:01 constructor:01 argument:01 argument:01 tuple:02 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: Richard Jones wrote: > Not a big problem, but strange nevertheless: > > # exception E of string * string;; > exception E of string * string Exception E is a constructor accepting two arguments, not a single tuple of two elements. > # let f () = raise (E ("a", "b"));; > val f : unit -> 'a = > # try f (); failwith "Not found" with E (a,b) -> (a,b);; > - : string * string = ("a", "b") > # try f (); failwith "Not found" with E t -> t;; > --- > The constructor E expects 2 argument(s), but is here applied to 1 argument(s) > > (In my actual code I want to return the thrown tuple to the caller). This is the point. Try exception E of (string*string) or type thrown_tuple = string * string exception E of thrown_tuple > Rich. > Alex -- ********************************************************************* http://www.barettadeit.com/ Baretta DE&IT A division of Baretta SRL tel. +39 02 370 111 55 fax. +39 02 370 111 54 Our technology: The Application System/Xcaml (AS/Xcaml) The FreerP Project