<div dir="ltr">Hi Bert,<div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 18, 2017 at 7:51 AM, Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);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-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="gmail-m_8485480560485415511gmail-">On Tue, 18 Jul 2017, Bert Freudenberg wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color: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="gmail-m_8485480560485415511gmail-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.</div></div></div></blockquote><div><br></div><div>This really doesn't make sense as it prevents any kind of change at all, e.g. to the class hierarchy, and as Nicolas points out, prevents updating objects if their class definitions are modified.</div><div><br></div><div>When we added "immutability" to VisualWorks (actually read-only objects) we held off, and made only literals immutable.  I'd like to see us make CompiledMethods immutable too, but this wold introduce complications in condensing changes/sources, adding/deleting breakpoints, etc.  One can provide an exception handler or a beMutableWhile: facility to make it easy to temporarily make read-only objects writable.</div><div><br></div><div>Or are you meaning that when an object is made immutable all its sub-state is made immutable too?  (An idea I have no problems with, provided it does't imply that classes can't change).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);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)"> And "mutableObj becomeForward: immutableObj copyHash: false" should be the only allowed become case.</div></div></div></blockquote><div><br></div><div>Agreed. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);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)">- Bert -<br></div></div></div></blockquote></div><br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>