[squeak-dev] Re: The Trunk: Kernel-eem.474.mcz

Wolfgang Eder edw at generalmagic.at
Fri Jul 23 15:04:45 UTC 2010


On 23.07.2010 14:42, Nicolas Cellier wrote:
[stuff snipped]
> [] once is equivalent to ifNil: [] indeed... But when I see some code
> crippled with ifNil: just to solve an initialization problem, I feel
> it's stinking personnally. It is unecessarily parasitically explicit.
> If I have a Shared variable used at ten places, then I have to pollute
> 10 places with ifNil:  for caring of lazy initialization...
[more stuff snipped]


well the [] once block needs to be in a method.
if the access to the global is also in a method
(accessor), then the call-sites are indistinguishable.

the shared var has one advantage imho: it can be easily
reset and reinitialized.
and one disadvantage: if you change the initialisation
code, it does not enforce that the shared var is updated
automatically.

thats the main (and only) distinction i can see.
just my 2c
thanks
wolfgang

Nicolas
>
>>
>> So Long,
>>         -Tobias
>>
>
>




More information about the Squeak-dev mailing list