[squeak-dev] The Trunk: Kernel-ul.709.mcz
frank.shearar at gmail.com
Wed Sep 5 11:27:01 UTC 2012
On 5 September 2012 12:10, Tobias Pape <Das.Linux at gmx.de> wrote:
> Am 05.09.2012 um 11:42 schrieb Frank Shearar:
>> On 4 September 2012 18:03, Frank Shearar <frank.shearar at gmail.com> wrote:
>>> On 4 September 2012 15:25, Levente Uzonyi <leves at elte.hu> wrote:
>>>> On Tue, 4 Sep 2012, Frank Shearar wrote:
>>>> No, but it would expose the environment dictionary and would make all these
>>>> methods pointless.
>>> Surely noone ever uses methods marked private!
>> OK, so how about pushing the env ifNil:  into ensure? Do you think
>> this would look a bit less weird?:
>> Process >> #environmentAt: key ifAbsentPut: aBlock
>> self ensureEnvironment.
>> ^env at: key ifAbsentPut: aBlock
>> I dislike the necessity to remember to "self ensureEnvironment" before
>> any access of env, but I take your point regarding exposing the
> What about
> Process >> #pvtEnvironment
> ^ env ifNil: [env := Dictionary new]
> Process >> #environmentAt: key ifAbsentPut: aBlock
> ^ self pvtEnvironment at: key ifAbsentPut: aBlock
> (naming subject to bikeshedding,
> eg, name it pvtEnvironment, ensureEnvironment, ensuredEnvironment,
> theEnvironment ...)
While #pvtEnvironment is more forceful than categorising #environment
as 'private' in indicating "don't use this", I expect Levente to still
say "yes but that still exposes the dictionary!"
More information about the Squeak-dev