[squeak-dev] true hash ^20

Chris Cunnington smalltalktelevision at gmail.com
Wed May 9 21:04:50 UTC 2012


Thinking about it, a hash is a part of a header of an object used to 
give an object a unique identity. nil, true, and false have a single 
instance per image. There is only one in the image for each and it's in 
ObjectMemory.

2.7 InterpreterSimulatorLSB

ObjectMemory>>nilObj  4
                           falseObj 12
                           trueObj 20

You cannot make two instances of nil. For the VM, which is all about 
numbers, and not really about classes, it will say "Is this object #4? 
Yes? It's nil"


nil hash 1681

nil hash 1681

nil == nil true

x := SystemTracer new hash 1136

y := SystemTracer new hash  394

x == y false

You could say that Chris is a class. And there are many instances of 
Chris. The last names Muller and Cunnington are the hash.

Chris == Chris false

I'm glad you asked this question. It made me think.

Chris








More information about the Squeak-dev mailing list