<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-07-18 16:51 GMT+02:00 Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><span style="font-family:arial,sans-serif;color:rgb(34,34,34)">On Tue, Jul 18, 2017 at 4:46 PM, Levente Uzonyi </span><span dir="ltr" style="font-family:arial,sans-serif;color:rgb(34,34,34)"><<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>></span><span style="font-family:arial,sans-serif;color:rgb(34,34,34)"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="m_-7765163349044760564gmail-">On Tue, 18 Jul 2017, Bert Freudenberg wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">    ​I don't know how the VM handles immutability in this case, but it's possible that it wouldn't let #become*: affect immutable objects.<br>
<br>
<br>
​I think that would be fine, you should​ be able to become an immutable object and vice versa.<br>
 <br>
      On the other hand, I'm sure it would let you change fields of immutable objects via #become*:, but that's not an issue in your case.<br>
<br>
<br>
​This is debatable ...​ I would rather have the VM raise an error when trying to become a field of an immutable object. Immutable should mean<br>
immutable, no?<br>
</blockquote>
<br></span>
#become: would become slow again if we had to find all objects referencing the one we're about to swap. Or, we'd have to make the whole object graph immutable when we make an object immutable. In that case #become: could just fail when the receiver or the argument is immutable.<span class="m_-7765163349044760564gmail-HOEnZb"><font color="#888888"><br></font></span></blockquote><div> </div></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​+1 for making the whole object graph be immutable. And "mutableObj becomeForward: immutableObj copyHash: false" should be the only allowed become case.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div></div></div></blockquote><div><br></div><div>What if I change a class or superclass of an immutable?<br></div><div>(think add or remove an instance variable)<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">- Bert -</div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">- Bert -​</div><br></div></div>
<br><br>
<br></blockquote></div><br></div></div>