Browse thread
Bug in equality testing?
- John Harrison
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | John Harrison <John.Harrison@c...> |
| Subject: | Bug in equality testing? |
Hi,
I've come across the following, which unless I am being stupid
looks like a bug. The program below produces (in 0.6):
true; true; false
John.
P.S. Thanks for the interesting replies on hash-consing. I'm afraid
I am likely to be pestering you with more questions about CAML soon.
It's a great system!
**********************************************
type Example = Var of string
| App of string * Example list;;
let DEST =
fun (App p) -> p
| (Var _) -> failwith "DEST";;
let a = DEST(App("X",([]: Example list)));;
let b = ("X",([]: Example list));;
fst(a) = fst(b);;
snd(a) = snd(b);;
a = b;;
**********************************************