caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] comparing references
@ 2003-08-11 18:54 Tahir H Butt
  2003-08-11 19:25 ` Michal Moskal
  0 siblings, 1 reply; 4+ messages in thread
From: Tahir H Butt @ 2003-08-11 18:54 UTC (permalink / raw)
  To: caml-list

I don't know for sure, so I decided to ask around. My question is this:
given two references, when one compares them, is it just the addressing
which is examined, or the actual content? For instance:

type symbol = Symbol of int
let a = ref (Symbol 1) in
let b = ref (Symbol 2) in
let c = ref (Symbol 1) in
....

upon inspection, a=c -> true, and a=b -> false, as desired. But, is this
comparison as simple as comparing two numbers? I ask because my sum
types can be big (I'm dealing with trees), so it would be good if when I
want to check if two trees are the same, all I need to do is look at the
references to them.

Thanks,

Tahir H Butt
Brown University
Cognitive and Linguistic Sciences
PhD Student
http://www.cog.brown.edu/~tahir

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2003-08-11 20:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-11 18:54 [Caml-list] comparing references Tahir H Butt
2003-08-11 19:25 ` Michal Moskal
2003-08-11 19:57   ` Hal Daume III
2003-08-11 20:02     ` Michal Moskal

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).