<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 9, 2013 at 6:48 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;</span> wrote:<br>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Well, maybe it&#39;s an overkill .. it is mainly about speed and reusing<br>
VM&#39;s lookup mechanism<br>
for searching a name over multiple scopes (when you have namespaces<br>
with imports).<br>
<br>
On a first run, you will replace<br>
&quot;read value of &lt;binding&gt;&quot; bytecode with &quot; send #value to &lt;binding&gt;&quot;<br>
but that implies having a binding at compile time (you must lookup for<br>
a name at compile time).<br>
It also means that you won&#39;t change anything semantically: even though<br>
you sending a message,<br>
you still accessing the very same state which you bound early at compile time.<br></blockquote><div><br></div><div>Right. The lookup happens at compile time. When the method is actually executed, we&#39;re just fetching the value from the binding we found at compile time. I don&#39;t see how that&#39;s going to be slow. In the most common case, a class reference, it&#39;s not even a message send, because we have a dedicated bytecode. For global variables, it&#39;ll be two message sends: we send #value to the alias binding, which then sends #value on to the canonical binding in the environment&#39;s &quot;contents&quot; dictionary. </div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Then, i wonder, if such change is actually worth doing. Because if you<br>
don&#39;t do lookup dynamically,<br>
then there is no change.<br></blockquote><div><br></div><div>Sure there is. We still bind names at compile time, but we have changed the way names are resolved. </div><div><br></div><div>Colin</div></div></div></div>