[squeak-dev] Re: Smalltalk vs SmalltalkImage current woes

Igor Stasenko siguctua at gmail.com
Fri Jul 24 10:39:07 UTC 2009


2009/7/24 Klaus D. Witzel <klaus.witzel at cobss.com>:
> On Fri, 24 Jul 2009 12:27:36 +0200, Igor Stasenko wrote:
>
>> I am currently using the Cuis, which doesn't having a 'SmalltalkImage
>> current' refactoring..
>> And this difference is a bit frustrating to me, especially when code
>> which have to be ported from Squeak,
>> i need to visit all the places and fix the references.
>>
>> I was not here when this change was introduced, and you maybe know ,
>> that i'm a heated enemy of global state.
>> But i understand the reasoning of dissection the Smalltalk dictionary
>> of globals from the rest of service methods & additional state,
>> which is needed and which were putted in SmalltalkImage class.
>>
>> But the more i thinking about it, the more i feel that this
>> 'dissection' can be done in least intrusive way which is much
>> friendlier to 'old ways'
>> but also plays well with 'current ways'.
>>
>> So, what i'm proposing:
>>
>> - make a dictionary of globals a pure dictionary, without any extra
>> unrelated methods.
>> - completely move all fat stuff into SmalltalkImage from SystemDictionary
>> class
>> - add 'globals' ivar to SmalltalkImage class , and add proxy methods
>> for accessing the dictionary, like #at: #at:put: etc.
>>
>> then simply:
>> Smalltalk at: #Smalltalk put: (SmalltalkImage current).
>
> This part will not work, check yourself:
>
>  (Smalltalk associationAt: #Smalltalk) inspect
>
in what way it wont work?
I can implement #associationAt: in SmalltalkImage class, to proxy it
to globals ivar. What's wrong with it?
Or do you mean, that we will end up with the need of proxying all
Collection protocol methods?
There always can be more radical solutions, like proxying rest of
stuff through DNU handler :)

> /Klaus
>
>> Now, Smalltalk == SmalltalkImage current and everyone is happy:
>>  - dictionary lives in separate ivar,
>>  - fat & boring housekeeping stuff lives in SmalltalkImage instance.
>>
>> What you think?
>>
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list