Version française
Home     About     Download     Resources     Contact us    
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: Julien Verlaguet <Julien.Verlaguet@p...>
Subject: A nastier example
Here is a nastier case than the one in the previous msg.

exception E of int;;

let x=E(1);;

exception E of bool;;

x=E(true);;

answer : true

I received many mails (in private), explaining to me how the equality 
works in OCaml, how exceptions are represented etc ...
Which is not what I was asking, I will try to reformulate :

Is this the behaviour we want ?

Can two values of different types be equal ?

I agree that this wouldn't be a problem if it would only work in a 
toplevel ... But it compiles in structures as well !!

J