From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 73A98BC0B for ; Tue, 30 Jan 2007 22:47:32 +0100 (CET) Received: from outmx010.isp.belgacom.be (outmx010.isp.belgacom.be [195.238.5.233]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0ULlVFb026117 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 30 Jan 2007 22:47:32 +0100 Received: from outmx010.isp.belgacom.be (localhost [127.0.0.1]) by outmx010.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id l0ULlUsD018018 for ; Tue, 30 Jan 2007 22:47:30 +0100 (envelope-from ) Received: from poincare.swapping.umh.ac.be (153.132-240-81.adsl-dyn.isp.belgacom.be [81.240.132.153]) by outmx010.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id l0ULlNjj017963; Tue, 30 Jan 2007 22:47:23 +0100 (envelope-from ) Received: from [127.0.0.1] (helo=localhost) by poincare.swapping.umh.ac.be with esmtp (Exim 4.63) (envelope-from ) id 1HC0ow-0002cz-1B; Tue, 30 Jan 2007 22:47:18 +0100 Date: Tue, 30 Jan 2007 22:46:57 +0100 (CET) Message-Id: <20070130.224657.08208845.Christophe.Troestler@umh.ac.be> To: "O'Caml Mailing List" Subject: Re: [Caml-list] Equality of functional values From: Christophe TROESTLER In-Reply-To: <20070130210747.GC15659@gaia.cc.gatech.edu> <20070130204109.GB15659@gaia.cc.gatech.edu> References: <20070130204109.GB15659@gaia.cc.gatech.edu> <20070130.220141.72363004.Christophe.Troestler@umh.ac.be> <20070130210747.GC15659@gaia.cc.gatech.edu> X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: Universite de Mons-Hainaut (http://math.umh.ac.be/an/) X-Mailer: Mew version 5.1.52 on Emacs 22.0.93 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 45BFBCF3.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; christophe:01 troestler:01 christophe:01 troestler:01 umh:01 0100,:01 explicitely:01 functor:01 pervasives:01 andrej:01 cheers:01 2007,:98 2007,:98 equality:01 equality:01 On Tue, 30 Jan 2007, Fernando Alegre wrote: > > On Tue, Jan 30, 2007 at 10:01:41PM +0100, Christophe TROESTLER wrote: > > On Tue, 30 Jan 2007, Fernando Alegre wrote: > > > > > > Add a new operator =. for floating-point-aware equality that works on > > > everything the way = works now. > > > > > > Would not this make everyone happy? > > > > No. > > Why not? Because, like several other people on this list, I am mostly writing numerical code and, while the behaviour w.r.t. NaN is only occasionally useful, it is good to have it as the standard (mandated by IEEE 754). See also http://caml.inria.fr/pub/ml-archives/caml-list/2001/02/bfbab5317267480356248b6e004c0eee.en.html > Because that is no good for libraries. Well, IMHO, for libraries you want to be able to declare the equality/comparison explicitely in the functions that need it (or else use a functor). On Tue, 30 Jan 2007, Fernando Alegre wrote: > > Revert = to its previous behavior: first check physical then structural > > On Tue, 30 Jan 2007, Tom wrote: > > > > > let ( = ) x y = Pervasives.compare x y = 0 > > > > Because it fails on functions Ok. I got mislead by Fernando's comment letting us think that it was the solution to the OP problem -- but did not check the OP post. Still, I don't think Andrej Bauer concern was properly addressed: what concrete problem do you want equality of functions for? Cheers, ChriS