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 C8E9FBCAB for ; Mon, 16 May 2005 10:43:13 +0200 (CEST) Received: from mail2.sun.ac.za (mail2.sun.ac.za [146.232.64.14]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j4G8hCM9015850 for ; Mon, 16 May 2005 10:43:13 +0200 Received: from burger.sun.ac.za ([146.232.128.30]) by mail2.sun.ac.za with esmtp (Exim 4.34) id 1DXbBv-0006TO-H1; Mon, 16 May 2005 10:43:11 +0200 Received: from js by burger.sun.ac.za with local (Exim 4.50) id 1DXbBv-0006Pw-Ev; Mon, 16 May 2005 10:43:11 +0200 Date: Mon, 16 May 2005 10:43:11 +0200 From: Johann Spies To: caml-list@yquem.inria.fr, caml-list@inria.fr Subject: Re: [Caml-list] question on exceptions Message-ID: <20050516084311.GH10979@sun.ac.za> Mail-Followup-To: Johann Spies , caml-list@yquem.inria.fr, caml-list@inria.fr References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Miltered: at nez-perce with ID 42885D20.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; spies:01 jspies:01 caml-list:01 bool:01 bool:01 val:01 exn:01 val:01 exn:01 spies:01 universiteit:01 stellenbosch:01 021:98 wrote:01 exception:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Fri, May 13, 2005 at 03:34:22PM +0200, Julien Verlaguet wrote: > I have the following peace of code > > exception E;; > let x=E;; > exception E;; > > I don't understand why the two following things are not equivalent : > > # x=E;; > - : bool = true > > # match x with > | E -> true > | _ -> false;; > - : bool = false > > Is this normal ? Maybe. I am no expert but I suspect the second "exception E;;" causes the behaviour that you saw. Look at this: # exception E;; let x=E;; exception E;; exception E # val x : exn = E # exception E # x=E;; - : bool = true # match x with | E -> true | _ -> false;; - : bool = false So far it is the same, but # exception E;; exception E # let x=E;; val x : exn = E # x=E;; - : bool = true # match x with | E -> true | _ -> false;; - : bool = true Regards Johann -- Johann Spies Telefoon: 021-808 4036 Informasietegnologie, Universiteit van Stellenbosch "In my Father's house are many mansions: if it were not so, I would have told you. I go to prepare a place for you. And if I go and prepare a place for you, I will come again, and receive you unto myself; that where I am, there ye may be also." John 14:2,3