Version française
Home     About     Download     Resources     Contact us    
Browse thread
Difference between != and <>
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: yoann padioleau <padator@w...>
Subject: Re: [Caml-list] Difference between != and <>

On 30 août 05, at 23:49, spiralvoice wrote:

> Hi,
>
> is there a difference between != and <> in Ocaml code?

Yes, the same kind of difference that between = and ==
"toto" <> "toto"
=> false

"toto" != "toto
=> true

let x = "toto" in x != x
=> false

It is a difference between structural equality (deep equality) and  
physical equality (shallow equality, or "pointer" equality).

By the way, one wonderful thing with computer science is that you can  
ask many questions to the machine :)


>
> Greetings, spiralvoice
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>