[squeak-dev] Re: The Trunk: Kernel-eem.474.mcz
travisgriggs at gmail.com
Fri Jul 23 04:21:58 UTC 2010
On Jul 22, 2010, at 7:57 PM, Andreas Raab 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.
The genesis of them (once blocks) is described in gory fireside chat
I later did a boring screencast showing a common use of them
integrated into the VW IDE:
We actually use them quite a bit.
If reading the above, what once blocks bring to the picture, is
basically something similar to compile time expressions. Or at least,
there's a large overlap of where a once block provides similar
advantages to a CTE. There's actually some benefits to doing it with
once blocks vs CTEs, for some cases. And I'm sure there's some places
where CTE's would be better.
"Some people are like slinkies, not really good for much, but they can
bring a smile to your face when you push them down the stairs."
More information about the Squeak-dev