On Sun, 7 Nov 2010, Benjamin wrote:


On Nov 7, 2010, at 10:51 AM, Stéphane Ducasse wrote:

SmalltalkImage current
        instVarAt: #globals put: SystemDictionary new

Something like that.


This code initialize Smalltalk, but I haven't found where Smalltalk is stored. Smalltalk is not a SmalltalkImage inst var nor class var neither Smalltalk class inst var ...
So I wonder where to find it ...

Smalltalk is a global. Globals are stored in a SystemDictionary. So far the only instance of SystemDictionary is the value of [Smalltalk globals]. Currently Smalltalk is a SmalltalkImage. SmalltalkImage has an instance variable called globals which holds the SystemDictionary. So

(Smalltalk globals at: #Smalltalk) == Smalltalk.

But SmalltalkImage also understands some of the protocol of SystemDictionary, because originally Smalltalk was a SystemDictionary, so you can write this too:

(Smalltalk at: #Smalltalk) == Smalltalk


Levente



Ben


?
On Nov 7, 2010, at 2:46 AM, Benjamin wrote:

Hi guys,

I wonder how SmalltalkImage create the Smalltalk instance.

Can someone explain me that ?




Thank you

Ben




Reply via email to