<div dir="ltr">So to implement becomeForward: with integer argument it is needed to scan all references to receiver and change pointers body to hold integer value.<div>Am I right?</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-17 13:52 GMT+01:00 David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On Thu, Mar 17, 2016 at 09:57:51AM +0100, Denis Kudriashov wrote:<br>
&gt;<br>
&gt; Hi.<br>
&gt;<br>
&gt; I investigate that #becomeForward: is not working for SmallInteger args. It<br>
&gt; is mentioned in method comment:<br>
&gt;<br>
&gt; Fails if either argument is a SmallInteger.<br>
&gt;<br>
&gt;<br>
&gt; I guess that it is not working for any immediate argument. For example it<br>
&gt; is failed for Character too.<br>
&gt;<br>
&gt; So I am interesting why it is not supported?<br>
<br>
</div></div>The become mechanism is swapping references to objects, such that the<br>
object pointers that pointed to one object are all now pointing to another.<br>
An immediate object such as SmallInteger is hiding its value within the<br>
object pointer itself (so it not really a pointer when used in this way).<br>
The immediate object &quot;pointer&quot; is therefore not able to participate in<br>
reference swapping.<br>
<br>
Dave<br>
<br>
</blockquote></div><br></div>