[squeak-dev] SmalltalkImage current vs Smalltalk: Option #3
siguctua at gmail.com
Fri Mar 5 05:58:11 UTC 2010
On 5 March 2010 06:24, Andreas Raab <andreas.raab at gmx.de> wrote:
> Folks -
> I've been working on this stuff a little now and (as always) things look
> different once you actually dug into it. There is a really interesting
> option here which I'd like to propose as option #3 since it does require a
> bit of refactoring but it makes good sense to me:
> * Move methods from SystemDictionary to SmalltalkImage.
> * Make SmalltalkImage current == Smalltalk.
> * Make Smalltalk globals class == SystemDictionary
> So far we're still with option #2, but now it gets interesting:
> * Use Smalltalk globals as Behavior>>environment, i.e.,
> "Return the environment in which the receiver is visible"
> ^Smalltalk globals
> * Remove any non-dictionary stuff from SystemDictionary; fix all
> non-dictionary uses of "self environment" (VERY few; much less than I
> * Remove all the dictionary methods from SmalltalkImage except #at:,
> #at:ifAbsent:, #at:ifPresent: (there simply are too many users of those to
> get rid of it but it avoids literally some 20+ methods that are required
> The result is that:
> 1) Smalltalk == SmalltalkImage current
> 2) Smalltalk class == SmalltalkImage
> 3) Smalltalk globals class == SystemDictionary
> 4) SomeClass environment == Smalltalk globals
> Interestingly, this is pretty much the way these entities are already used;
> just not consistently. After browsing through quite a bit of code that does
> feel like the most natural separation - the environment as the dictionary /
> namespace; Smalltalk as the system-wide facade for various things.
> What do you think?
That's pretty much what i envisioned.
> - Andreas
Igor Stasenko AKA sig.
More information about the Squeak-dev