[squeak-dev] Re: The Trunk: Kernel-eem.474.mcz
eliot.miranda at gmail.com
Fri Jul 23 05:24:35 UTC 2010
On Thu, Jul 22, 2010 at 7:57 PM, Andreas Raab <andreas.raab at gmx.de> wrote:
> On 7/22/2010 6:26 PM, Eliot Miranda wrote:
>> The VW implementation relies on "clean
>> blocks" where the compiler creates a literal block provided the block
>> doesn't reference its outer environment.
> I see. Sounds like a hack :-) What's wrong with the straightforward:
> ^SomeResource ifNil:[self initializeSomeResource]
> ? It explicitly documents that there is a shared resource by naming it
> which is a good thing in my understanding.
What's "wrong", or at least not as nice, is the variable and its
declaration. The [expr] once form is entirely self-contained whereas the
SomeResource ifNil: [self initializeResource] is accompanied with a variable
declaration somewhere else. I also like (but haven't seen used) the notion
of having variations on once such as onceInEverySession which can again
provide the necessary void-on-startup hook without any explicit registering
in a start-up list.
I do take your point about it being a hack, but its a neat hack.
> - Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev