So what are the semantics to BlockClosure&#39;s?  When are the values of temps bound to the block?<div><br><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 11:02 AM, Randal L. Schwartz <span dir="ltr">&lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">&gt;&gt;&gt;&gt;&gt; &quot;Randal&quot; == Randal L Schwartz &lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt; writes:<br>

<br>
&gt;&gt;&gt;&gt;&gt; &quot;John&quot; == John Chludzinski &lt;<a href="mailto:john.chludzinski@gmail.com">john.chludzinski@gmail.com</a>&gt; writes:<br>
John&gt; How about:<br>
John&gt; test1<br>
<br>
John&gt; | block w z |<br>
John&gt; w := 3. z := 12.<br>
John&gt; block := { [ :a :b | Transcript show: a asString , &#39;   &#39; , b asString; cr ]<br>
John&gt; . w . z }.<br>
John&gt; w := 0. z := 1.<br>
John&gt; (block at: 1) value: (block at: 2) value: (block at: 3)<br>
<br>
</div>Randal&gt; Yeah, now that closures work, you could effectively curry the values:<br>
<br>
Randal&gt;     | block w z |<br>
Randal&gt;     w := 3.<br>
Randal&gt;     z := 12.<br>
Randal&gt;     block :=<br>
Randal&gt;       [:captureW :captureZ |<br>
Randal&gt;         [Transcript show: captureW asString , &#39; &#39; , captureZ asString; cr]]<br>
Randal&gt;           value: w value: z.<br>
<br>
Randal&gt;     w := 0.<br>
Randal&gt;     z := 1.<br>
<br>
Randal&gt;     block value.  &quot;should still show 3, 12&quot;<br>
<br>
Randal&gt; There might even be a method for that... or it might have just been<br>
Randal&gt; Seaside specific.<br>
<br>
Ahh yes, #cull:cull:<br>
<div class="im"><br>
    | block w z |<br>
    w := 3.<br>
    z := 12.<br>
</div>    block := [:newW :newZ | ... ] cull: w cull: z.<br>
<div class="im">    w := 0.<br>
    z := 1.<br>
    block value.<br>
<br>
</div>Should do it.<br>
<div><div></div><div class="h5"><br>
--<br>
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095<br>
&lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt; &lt;URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">http://www.stonehenge.com/merlyn/</a>&gt;<br>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.<br>
See <a href="http://methodsandmessages.vox.com/" target="_blank">http://methodsandmessages.vox.com/</a> for Smalltalk and Seaside discussion<br>
</div></div></blockquote></div><br></div>