<br><br><div class="gmail_quote">On Thu, Jul 22, 2010 at 5:14 PM, Andreas Raab <span dir="ltr">&lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On 7/22/2010 8:42 PM, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Eliot Miranda uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-eem.474.mcz" target="_blank">http://source.squeak.org/trunk/Kernel-eem.474.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-eem.474<br>
Author: eem<br>
Time: 22 July 2010, 1:42:05.4 pm<br>
UUID: 292f2cc5-ba81-4d03-a64f-4e7cb878d68f<br>
Ancestors: Kernel-eem.473<br>
<br>
BlockClosure&gt;&gt;#once Travis Griggs&#39; neat idiom for interning values of computations.  Use e.g. as in<br>
        myResourceMethod<br>
                ^[time-consuming computation] once<br>
<br>
</blockquote>
<br>
What am I missing?<br>
<br>
Object compile: &#39;onceTest<br>
        &quot;Just once please&quot;<br>
<br>
        ^[Transcript cr; show: &#39;&#39;only once&#39;&#39;] once&#39;.<br>
        <br>
#(1 2 3) collect: #onceTest.<br></blockquote><div><br></div><div>...that I&#39;m a complete moron.  The VW implementation relies on &quot;clean blocks&quot; where the compiler creates a literal block provided the block doesn&#39;t reference its outer environment.  The current closure compiler doesn&#39;t perform the optimization so it doesn&#39;t work; a new block is being created on each invocation of the method.  A test that will work is e.g.</div>
<div><br></div><div>    | b |</div><div>    b := [Object new].</div><div>    self assert: b once == b once</div><div> </div><div>So I need to do some work in the compiler and step back on my &quot;Its portable&quot; claim.</div>
<div><br></div><div>Eliot</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Cheers,<br><font color="#888888">
  - Andreas<br>
<br>
</font></blockquote></div><br>