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: 2005-05-14 (14:51)
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;;


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 !!