From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p7IAgTxb014961 for ; Thu, 18 Aug 2011 12:42:30 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnABACHsTE7B/BfVlGdsb2JhbABCqQMBAQEBCQsJCRQDIoFAAQEFOEARCxgJFg8JAwIBAgFFBg0IAQGHbrkShkgEkxOFDItr X-IronPort-AV: E=Sophos;i="4.68,244,1312149600"; d="scan'208";a="105748314" Received: from msa04.smtpout.orange.fr (HELO msa.smtpout.orange.fr) ([193.252.23.213]) by mail4-smtp-sop.national.inria.fr with ESMTP; 18 Aug 2011 12:42:30 +0200 Received: from [192.168.1.63] ([83.199.49.118]) by mwinf5d66 with ME id Mmio1h0032Z0S2z03mioqx; Thu, 18 Aug 2011 12:42:49 +0200 X-ME-engine: default Message-ID: <4E4CEC97.9010202@frisch.fr> Date: Thu, 18 Aug 2011 12:42:31 +0200 From: Alain Frisch User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.20) Gecko/20110804 Thunderbird/3.1.12 MIME-Version: 1.0 To: caml-list References: <4E4CC071.1060900@inria.fr> <20110818080254.GA10854@ccellier.rd.securactive.lan> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] [Ann] Zarith On 08/18/2011 10:58 AM, Gabriel Scherer wrote: > I believe the comparison hardening was made desirable by the expected > use of first-class modules to encode existential datatypes: with > existential datatypes you may try to use the polymorphic comparison > operators on two values of the same (existential) datatype having > different internal representations. The problem didn't happen with the > previous encoding of existential types using first-class polymorphism, > as it implies packing the value inside closures, so the polymorphic > comparison operators were not usable. The problem existed before, because of exceptions. When two exception values having constructors with the same name are compared with the polymorphic equality, their arguments are compared structurally even if they don't have the same type. (One way to address this would be to have a special tag on exception values to force physical comparison of the constructors.) -- Alain