Browse thread
[Caml-list] Semantics of physical equality
[
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: | sejourne kevin <sejourne_kevin@y...> |
| Subject: | Re: [Caml-list] Semantics of physical equality |
--- Michal Moskal <malekith@pld-linux.org> a écrit :
> On Fri, Feb 27, 2004 at 10:32:29PM +0100, Basile
> STARYNKEVITCH wrote:
> > On Fri, Feb 27, 2004 at 02:29:50PM -0600, Kevin S.
> Millikin wrote:
> > > I'm trying to figure out what I can rely on
> about physical equality.
> > > I've checked the OCaml manual but can't seem to
> find what I want to
> > > know.
> > >
> > > Presume
> > >
> > > # type t = V0 | V1 of int;;
> > > type t = V0 | V1 of int
> > >
> > > # V0 == V0;;
> > > - : bool = true
> > >
> > > V0's are the same. Is this guaranteed?
> >
> > Yes.
>
> Is it?
>
> "On non-mutable structures, the behavior of (==) is
> implementation-dependent;" [1]
>
> [1]
>
http://caml.inria.fr/ocaml/htmlman/libref/Pervasives.html
Ho!
A definition for mutable structures look ambiguous to
me:
type test =
{
mutable a:int;
b:int
};;
let r = {a=0;b=2};;
let x = r and y = r in
assert((x.a==y.a)&&(x.b==y.b)&&(x==y))
;;
Does this always ok ?
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com
-------------------
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