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 B4335BC48 for ; Thu, 28 Apr 2005 18:29:01 +0200 (CEST) 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 j3SGT1ex009305 for ; Thu, 28 Apr 2005 18:29:01 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA06861 for ; Thu, 28 Apr 2005 18:29:01 +0200 (MET DST) Received: from [128.93.8.130] (macadam.inria.fr [128.93.8.130]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j3SGT0u7025992 for ; Thu, 28 Apr 2005 18:29:01 +0200 Mime-Version: 1.0 (Apple Message framework v622) In-Reply-To: <20050428100252.GF31263@lami.univ-evry.fr> References: <20050428100252.GF31263@lami.univ-evry.fr> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <8852d39274286c54b275df0161a1f76e@inria.fr> Content-Transfer-Encoding: 7bit From: Damien Doligez Subject: Re: [Caml-list] Changes on equality between 3.06 and 3.08.3 Date: Thu, 28 Apr 2005 18:29:00 +0200 To: caml users X-Mailer: Apple Mail (2.622) X-Miltered: at concorde with ID 42710F4D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42710F4C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; damien:01 damien:01 caml-list:01 ocaml:01 val:01 bug:01 ocaml:01 wrote:01 exception:01 equality:01 equality:01 doligez:01 doligez:01 michel: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 Apr 28, 2005, at 12:02, Olivier Michel wrote: > I just noticed the following change in Ocaml between release 3.06 and > 3.08.3, as far > as equality on records is concerned : > > # type toto = { b : int -> int; };; > type toto = { b : int -> int; } > # let a = { b = (fun x -> x) } ;; > val a : toto = {b = } > # a = a;; > Exception: Invalid_argument "equal: functional value". > > > Is this supposed to be a bug, or a feature ? Will future releases of > Ocaml follow > the new way of handling equality between records or the old one ? New feature. Carefully thought out. Well documented. Ultimately caused by a strange wart of the IEEE floating-point standards. You should use the "compare" function if you want the old behaviour. -- Damien