caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] exceptions and the polymorphic equality
@ 2001-07-15 13:05 eijiro_sumii
  2001-07-16 14:44 ` Nils Goesche
  2001-07-16 15:11 ` Pierre Weis
  0 siblings, 2 replies; 10+ messages in thread
From: eijiro_sumii @ 2001-07-15 13:05 UTC (permalink / raw)
  To: caml-list; +Cc: sumii

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-07-18 13:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-15 13:05 [Caml-list] exceptions and the polymorphic equality eijiro_sumii
2001-07-16 14:44 ` Nils Goesche
2001-07-16 14:58   ` Xavier Urbain
2001-07-16 15:02     ` Xavier Urbain
2001-07-16 15:58       ` Nils Goesche
2001-07-16 15:11 ` Pierre Weis
2001-07-17  0:59   ` eijiro_sumii
2001-07-17 14:35     ` Nils Goesche
2001-07-18  0:28       ` eijiro_sumii
2001-07-18 13:36         ` Nils Goesche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).