identity and equivalence in Squeak

Doug Way dway at riskmetrics.com
Thu Feb 13 17:53:26 UTC 2003


shane at shaneroberts.com wrote:
> 
> ...
> On the other hand:
> 
> a := 'aaa'
> b := 'aaa'
> a = b
> a == b
> 
> produces:
> 
> a = b false
> a == b false

You must have done something wrong here.

a := 'aaa'
b := 'aaa'
a = b

When I execute these three lines in a new workspace, either one at a time or
all together (separated by periods), the result of a = b is true, not false.

> I thought:
> a = b
> 
> should produce:
> a = b true
> 
> because a and b are equal (for string comparison) though not
> identical (the same object).

You are right, it should be true.  And it *is* true. :-)

- Doug Way



More information about the Squeak-dev mailing list