<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks Ron.&nbsp; That was interesting to look into but I wasn't clear with
my query.&nbsp; It was not so much with the equality comparison but with the
difference in the assignment to (x) and (y) between the two examples
and the second item of the resulting OrderedCollection (which I have
changed to upper caps).<br>
<br>
I had thought that the two assignments of 'xxx' to (x) and (y) would
result in different objects, but they turn out to be identical.&nbsp; It is
like the compiler has noticed that they are equal and chosen to make
them identical.&nbsp; Then again, perhaps as literals they can be considered
identical - just not what I was expecting.<br>
<br>
cheers, Ben<br>
<br>
Ron Teitelbaum wrote:
<blockquote cite="mid:0cd601ccccfe$d916eea0$8b44cbe0$@usmedrec.com"
 type="cite">
  <pre wrap="">Hi Ben,

Have a look at the method for yourself.  Check out the method = on the
instance side of String. 

It should be pretty obvious when you get to the actual string comparison.

All the best,

Ron Teitelbaum

  </pre>
  <blockquote type="cite">
    <pre wrap="">-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:beginners-bounces@lists.squeakfoundation.org">beginners-bounces@lists.squeakfoundation.org</a> [<a class="moz-txt-link-freetext" href="mailto:beginners">mailto:beginners</a>-
<a class="moz-txt-link-abbreviated" href="mailto:bounces@lists.squeakfoundation.org">bounces@lists.squeakfoundation.org</a>] On Behalf Of Ben Coman
Sent: Saturday, January 07, 2012 12:15 AM
To: A friendly place to get answers to even the most basic questions about
Squeak.
Subject: [Newbies] Testing = and == in workspace

I was trying to confirm the operation of = and == in the workspace by
executing the following code..

x :=  'xxx'.
y :=  'xxx'.
z := x.
(OrderedCollection new) add: (x = y) ; add: (x == y) ; add: (x=z); add:
(x==z); yourself.

I was confused that I was getting anOrderedCollection(true TRUE true true)

It was not until I changed to the following code...

x := String newFrom: 'xxx'.
y := String newFrom: 'xxx'.
z := x.
(OrderedCollection new) add: (x = y) ; add: (x == y) ; add: (x=z); add:
(x==z); yourself.

that I got the expected anOrderedCollection(true FALSE true true)

I was curious what was going on in the first case.

cheers, Ben
_______________________________________________
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/mailman/listinfo/beginners">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->

_______________________________________________
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/mailman/listinfo/beginners">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a>

  </pre>
</blockquote>
<br>
</body>
</html>