[squeak-dev] SmalltalkImage current vs. Smalltalk

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Mar 2 09:05:13 UTC 2010

2010/3/2 Bert Freudenberg <bert at freudenbergs.de>:
> On 02.03.2010, at 05:08, Andreas Raab wrote:
>> Folks -
>> I was just trying to load some other code and once too many I got bitten by this silly SmalltalkImage current vs. Smalltalk stuff, so I'll fix it now. The only question is which way. There are two alternatives which achieve the goal of "SmalltalkImage current == Smalltalk":
>> 1) The Cuis variant: Move all the code back to SystemDictionary; implement SmalltalkImage current as ^Smalltalk.
>> Pro: Compatible with Cuis.
>> Con: Lack of separation of concerns.
>> 2) The inverse Cuis variant: Move all the code from SystemDictionary to SmalltalkImage; add a 'globals' variable (populated by an instance of SystemDictionary) and convert everything roughly like this:
>>       SmalltalkImage current globals: Smalltalk.
>>       Smalltalk := SmalltalkImage current.
>> Pro: Better separation of concerns.
>> Con: Different from Cuis.
>> I really don't care which way we do it; all I want is to get out of the mess we've created by introducing "SmalltalkImage current".
>> If you have an opinion, voice it, otherwise I'll just pick one.
>> Cheers,
>>  - Andreas
> 1) +1
> 2) -0
> - Bert -

I won't propose anything here.
Just invite to think of it.

As noticed by Ronald, the main problem with SmalltalkImage is that it
does not represent any Object indeed...
It's just a place holder for some system utilities...

When I see idioms like (SmalltalkImage current vmParameterAt:
parameterIndex), I just wonder why not (SmalltalkVM current
parameterAt: parameterIndex)....
If the VM where reified anyway, I would as well understand (Smalltalk
vm parameterAt: parameterIndex).

Sure, Marcus & Steph were right: why the hell a SystemDictionary
should know about the image file name or some vm parameter ?
Except that Smalltalk was not only a SystemDictionary but the
interface to "System" parameters fora very long time (st80)...
And as we can see under vmParameter idiom light, SmalltalkImage is
arbitrary. At least as arbitrary as Smalltalk.
Just less readable, adding an unnecessary current complexification...
Yes, current is just meaningless indeed until you start playing with
some sort of hydra VM and gain access to an external image (a frozen
ObjectMemory, or its Image file dump).
In the interim, a global named #System  would have been far better
understood (or #Squeak if we don't want to be portable across forks)

That's where Stephane and Marcus failed...
... replacing a well known hack (Smalltalk == System) with something
not solid enough.
When you break such habits (and code) you have to sell it with well
thought replacement.

Though, when I see code like (Smalltalk cleanUpUndoCommands), I can't
help thinking Steph and Marcus intention was right...


More information about the Squeak-dev mailing list