Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] exceptions and the polymorphic equality
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: eijiro_sumii@a...
Subject: [Caml-list] exceptions and the polymorphic equality
Hello,

I have a question about the polymorphic equality and exceptions: it
seems to me that the behaviour of "=" is counter-intuitive with
respect to pattern matching of exceptions, for example as follows.

        Objective Caml version 3.01

# exception Foo;;
exception Foo
# let e = Foo;;
val e : exn = Foo
# exception Foo;;
exception Foo
# let e' = Foo;;
val e' : exn = Foo
# e = e';;
- : bool = true
# match e with Foo -> true | _ -> false;;
- : bool = false
# try raise e with Foo -> ();;
Uncaught exception: Foo.
# 

I know that the two Foo's above should be distinct, but then shouldn't
e = e' also return false?  Is this issue well known?

	Eijiro
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr