Re:Smalltalk: Welcome to the Balkans
by spooneybarger on Friday February 12, 2010 @08:20AM
(#1120447)
Yes you can because 'a' is an object and your array [1,2] is a different object. They have the same value but a different identity. You can use a smalltalk inspector to see both value and identity.
But can you do this in Smalltalk? OK, you have inspectors that show you a representation of your data, but the representation is incomplete. I haven't used Smalltalk in years, so I'll gave an example in Python to show what I mean:
(b) and (c) initiallly have the same representation, but they behave differently. I don't like this, so I'm creating a language where the text representation of an object defines how it behaves: if two objects have the sdame representation, their internal structure is the same, and their behaviour will (with one exception) be the same. This representation format is used as a serialisation format, and is also used to write literals in the language. This means that it's possible to display precisely the value of any object, including all the sub-objects it contains.