identity in Squeak

Bijan Parsia bparsia at email.unc.edu
Sat Jun 15 18:55:55 UTC 2002


On Sat, 15 Jun 2002, nicola farina wrote:

> hi all,
> just one question:
> 
> why in Squeak evaluating the command
>  'fooBar' == 'fooBar'
> returns true (as if were Symbols)?

It's not as if they were Symbols. It's as if they were the same
string. Which they are. Literals written in the same lexical context get
"collapse" to the same object. Compare:

  	'foo' == 'foo' copy


And

	|a b |	
	a := b := 'foo'.
	a == b.

Your line is more like the latter than the former.

Cheers,
Bijan Parsia.




More information about the Squeak-dev mailing list