This site is updated infrequently. For up-to-date information, please visit the new OCaml website at ocaml.org.

Equality of functional values
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
 Date: 2007-01-30 (21:47) From: Christophe TROESTLER Subject: Re: [Caml-list] Equality of functional values
```On Tue, 30 Jan 2007, Fernando Alegre <fernando@cc.gatech.edu> wrote:
>
> On Tue, Jan 30, 2007 at 10:01:41PM +0100, Christophe TROESTLER wrote:
> > On Tue, 30 Jan 2007, Fernando Alegre <fernando@cc.gatech.edu> 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).

> 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 <fernando@cc.gatech.edu> wrote:
>
> Revert = to its previous behavior: first check physical then structural
>
> On Tue, 30 Jan 2007, Tom <tom.primozic@gmail.com> 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

```