in inbox as Compiler-eem.140<br><br><div class="gmail_quote">On Thu, May 20, 2010 at 9:15 AM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><br><div class="gmail_quote"><div class="im">On Thu, May 20, 2010 at 9:04 AM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Oops.  Find fix attached:<div><br></div><div>LiteralVariableNode methods for code generation (new scheme)</div><div><div><div>sizeCodeForStorePop: encoder</div><div><span style="white-space:pre">        </span>self reserve: encoder.</div>


<div><span style="white-space:pre">        </span>^(key isVariableBinding and: [key isSpecialWriteBinding])</div></div><div><span style="white-space:pre">                </span>ifTrue: [(self sizeCodeForStore: encoder) + encoder sizePop]</div>


<div><span style="white-space:pre">                </span>ifFalse: [encoder sizeStorePopLiteralVar: index]</div><div><br></div>Arguably the compiler should issue an error, but the error is raised at run-time because the generated code sends value: (correct) rather than using any of the store lit var bytecodes.  If a compiler error is wanted (my preference) then find attached:</div>


<div><br></div></blockquote><div><br></div></div><div>Except that this is wrong:</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
</div><div>LiteralVariableNode methods for testing</div>
<div><div>assignmentCheck: encoder at: location</div><div><div><span style="white-space:pre">        </span>^(key isVariableBinding and: [key isSpecialWriteBinding])</div>
</div><div><span style="white-space:pre">                </span>ifTrue: [location]</div><div><span style="white-space:pre">                </span>ifFalse: [-1]</div></div></blockquote><div><br></div></div><div>It will cause an error when assigning to IslandVariables in Croquet.  So it must be</div>

<div><br></div><div>LiteralVariableNode methods for testing</div><div><div>assignmentCheck: encoder at: location</div><div><span style="white-space:pre">        </span>^(key isVariableBinding and: [key canAssign not])</div>
<div><span style="white-space:pre">                </span>ifTrue: [location]</div><div><span style="white-space:pre">                </span>ifFalse: [-1]</div><div><br></div><div>Find attached.</div></div><div class="im">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div><div><br><div class="gmail_quote">On Thu, May 20, 2010 at 2:16 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Open a browser, pick any class, and enter the code:<br>
<br>
foo<br>
        WorldState := nil<br>
<br>
then accept it.<br>
The compiler goes into an infinite recursion in<br>
LiteralVariableNode&gt;&gt;sizeCodeForStorePop:.<br>
<br>
sizeCodeForStorePop: encoder<br>
        self reserve: encoder.<br>
        ^(key isVariableBinding and: [key isSpecialWriteBinding])<br>
                ifTrue: [(self sizeCodeForStorePop: encoder) + encoder sizePop]<br>
                ifFalse: [encoder sizeStorePopLiteralVar: index]<br>
<br>
<br>
(Pharo 1.1 having no such problem - it accepts a code without any warnings.. )<br>
<br>
AFAIK, it should either warn or throw an error that assignment is not<br>
possible into read-only variable binding.<br>
<font color="#888888"><br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</font></blockquote></div><br></div>
</div></div></blockquote></div></div><br>
</blockquote></div><br>