3.9 vs. 3.10 : Closures, fixTemps

Mathieu Suen mathk.sue at gmail.com
Wed Dec 19 09:58:32 UTC 2007


Hi

What #fixTemps do is copy the home context.
for example

#(1 2 3) collect: [:each | [each <  3]] collect: [:block | block value]
result is: #(false false false)

you then need a #fixTemps:

#(1 2 3) collect: [:each | [each <  3] fixTemps] collect: [:block |  
block value]
result is: #(true true false)

Here the temp call each will  exist in 3 different context.
The 3 block [each < 3] will have 3 different parent.

HTH

On Dec 18, 2007, at 7:10 PM, itsme213 wrote:

> Do block closures work right in 3.9? 3.10?
>
> I am struggling with local variables used across nested blocks (Magma
> #commit: within Seaside #callback: or Scriptaculous  
> #triggerInPlaceEditor
> etc.) and am finding it quite frustrating. I had some #fixTemps but am
> totally guessing at when and why to use it.
>
> Thanks - Sophie
>
>
>
>

	Mth






More information about the Squeak-dev mailing list