<br><br><div class="gmail_quote">On Tue, Apr 26, 2011 at 12:50 PM, Henrik Sperre Johansen <span dir="ltr">&lt;<a href="mailto:henrik.s.johansen@veloxit.no">henrik.s.johansen@veloxit.no</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Say you have Class A:<br>
inst vars : one two three<br>
<br>
and method compiled on it:<br>
foo<br>
^one<br>
<br>
Then you also have Class B:<br>
inst vars: three two one<br>
<br>
Then you do<br>
methodFoo := A &gt;&gt; #foo<br>
methodFoo executeWithReceiver: B new one: 1; three: 3; yourself arguments:<br>
#()<br>
<br>
It&#39;ll return 3, which&#39;ll probably confuse those not very familiar with the<br>
bytecodes.<br>
<br>
Or using a class with no instvars, it&#39;ll crash in a similar manner to what<br>
you get if you currently do:<br>
Test methodDictionary at: #foo put: MCPackage &gt;&gt; #packageInfo.<br>
Test &gt;&gt; #foo.<br>
Test new foo<br></blockquote><div><br>You see, now I got it :)  I am just slow. <br>Thanks Henrik for this example. In fact, it was not even obvious for me until you told me. The &quot;problem&quot; is that the bytecodes to access/set instanceVariables work by position instead of name, no?<br>
I mean, &#39;one&#39; is never put in the literals of  A &gt;&gt; #foo <br><br>Nevertheless, exactly the same happens with #valueWithReceiver:arguments:    so...ok, we have this problem but we also have from before ;)<br>
right ?<br><br>solutions?<br><br>First I would put a nice comment in #valueWithReceiver:arguments:   and #valueWithReceiver:arguments:  <br><br>Second, if I understood you correctly you mean to do in your previous email, you want to validate that the class of the receiver is the same as the class where the CompiledMethod is installed and if it is not, throw an error ?<br>
<br>On the one hand that would limit a bit the usage because that fails only when there is instance var access, doesn&#39;t it?  On the other hand, it prevents some crashes or weird cases where the results are not the expected ones. <br>
<br>Opinions?<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<font color="#888888"><br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://forum.world.st/Method-executing-but-not-sent-to-the-receiver-tp3417511p3475162.html" target="_blank">http://forum.world.st/Method-executing-but-not-sent-to-the-receiver-tp3417511p3475162.html</a><br>

Sent from the Squeak VM mailing list archive at Nabble.com.<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>