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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id AB097BC0B for ; Tue, 30 Jan 2007 23:06:03 +0100 (CET) Received: from sark4.cc.gatech.edu (sark4.cc.gatech.edu [130.207.7.19]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0UM60Y1001062 for ; Tue, 30 Jan 2007 23:06:03 +0100 Received: from gaia.cc.gatech.edu (gaia.cc.gatech.edu [130.207.3.8]) by sark4.cc.gatech.edu (8.13.6/8.12.8) with ESMTP id l0UM5vur016129; Tue, 30 Jan 2007 17:05:57 -0500 (EST) Received: (from fernando@localhost) by gaia.cc.gatech.edu (8.13.6/8.12.8) id l0UM5vi3003114; Tue, 30 Jan 2007 17:05:57 -0500 (EST) Date: Tue, 30 Jan 2007 17:05:57 -0500 From: Fernando Alegre To: Christophe TROESTLER , caml-list@inria.fr Subject: Re: [Caml-list] Equality of functional values Message-ID: <20070130220557.GD15659@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> <20070130.224657.08208845.Christophe.Troestler@umh.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070130.224657.08208845.Christophe.Troestler@umh.ac.be> User-Agent: Mutt/1.4.2.1i X-Miltered: at concorde with ID 45BFC148.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0100,:01 christophe:01 troestler:01 0100,:01 christophe:01 troestler:01 ocaml:01 ocaml:01 explicitely:01 functor:01 2007,:98 2007,:98 equality:01 equality:01 polymorphic:01 On Tue, Jan 30, 2007 at 10:46:57PM +0100, Christophe TROESTLER wrote: > 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). So you are happily using +. and *. for floats now. Why not use a similar operator =. for float comparison? The point is that floats in OCaml _are_ treated especially anyway. > > See also http://caml.inria.fr/pub/ml-archives/caml-list/2001/02/bfbab5317267480356248b6e004c0eee.en.html There are two separate notions of equality mixed together. My point is, should "OCaml polymorphic equality" be the same concept at "IEEE equality"? Why not wish for three separate operators (=,== and =.)? > > > 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). I mean external libraries which I would not like having to change at every source file. Fernando