Identity vs equality (was Re: [Newbies] Assignment)

Alexander Lazarević Alexander at Lazarevic.de
Mon Aug 13 08:40:18 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andreas Raab schrieb:
> Keith Hodges wrote:
>> Surely the question is one of value versus identity. Which leads to
>> the question, what 'value' does #hello represent. To me the fact that
>> it is a symbol is an implementation detail encapsulated inside the
>> implementation. Its external behaviour is that of a string literal
>> (i.e. immutable) as is its value.
>>
>> I see this as analogous with numbers. Is 1 = 1.0 and 1.0 = 1. I should
>> hope so. 1.0 is implemented according to the float internal
>> representation, and 1, is implemented as a literal.
> 
> Thanks for the example. It's a very good analogy.

Is it? I think one could argue, that 1 is just an abbreviation of 1.0
and since N is a subset of R, 1.0 in N is "the same object" as 1.0 in R. No?
Further the values of 1kg and 1km are both numbers like strings and
symbols are sequences of characters, but I wouldn't say that 1kg=1km.
Nothing forbids literal strings to be immutable, like they are in
VisualWorks, but literal strings won't become Symbols just because of that.

Alex
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGwBjxYiF2wSTEZ9gRAn6wAJ9zbi9vfcPRzpANPP4rMk/8i7EbaQCfRIC1
aUkXq5s82zceZqDz0c8/JwY=
=C/nO
-----END PGP SIGNATURE-----


More information about the Squeak-dev mailing list

Squeak-dev list courtesy of The InternetOne and tric, the new way