From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 52DAFBCAB for ; Sat, 14 May 2005 18:09:57 +0200 (CEST) Received: from ux9.sp.cs.cmu.edu (UX9.SP.CS.CMU.EDU [128.2.220.166]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id j4EG9uQH014416 for ; Sat, 14 May 2005 18:09:57 +0200 Received: from [24.3.154.200] ([24.3.154.200]) by ux9.sp.cs.cmu.edu id aa16746; 14 May 2005 11:09 EDT Received: from ecc by stratocaster.home with local (Exim 4.50) id 1DWyGE-0007Pu-Pk for caml-list@yquem.inria.fr; Sat, 14 May 2005 11:09:02 -0400 Date: Sat, 14 May 2005 11:09:02 -0400 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] A nastier example Message-ID: <20050514150902.GB28128@localhost> Mail-Followup-To: caml-list@yquem.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 From: Eric Cooper X-Miltered: at nez-perce with ID 428622D4.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 bool:01 ocaml:01 reformulate:01 exn:01 val:01 exn:01 bool:01 ...:98 wrote:01 exception:01 exception:01 equality:01 exceptions:01 behaviour: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 Sat, May 14, 2005 at 04:51:07PM +0200, Julien Verlaguet wrote: > Here is a nastier case than the one in the previous msg. > > exception E of int;; > > let x=E(1);; > > exception E of bool;; > > x=E(true);; > > answer : true > > I received many mails (in private), explaining to me how the equality > works in OCaml, how exceptions are represented etc ... > Which is not what I was asking, I will try to reformulate : > > Is this the behaviour we want ? > > Can two values of different types be equal ? But these aren't different types -- they're both type "exn". For example: let test e = (e = Exit) val test : exn -> bool = So test can be applied to any exception, no matter what kind of structure it has. -- Eric Cooper e c c @ c m u . e d u