Version française
Home     About     Download     Resources     Contact us    

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

Browse thread
A nastier example
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] A nastier example
On Saturday 14 May 2005 15:51, Julien Verlaguet wrote:
> Is this the behaviour we want ?

Ideally, no.

> Can two values of different types be equal ?

In theory, no.

> I agree that this wouldn't be a problem if it would only work in a
> toplevel ...

Does code ever work differently in the top-level than when compiled (with 
ocamlc)? Should it?

> But it compiles in structures as well !! 

I think everyone would agree that there are caveats here but this is a 
question of trade-offs. So the question should be "how can we improve upon 
the current implementation?". To which the answer, for me at least, is "I 

There are many pitfalls associated with equality in OCaml but the existence of 
polymorphic comparisons is easily justified by their usefulness, IMHO.

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists