<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 18, 2017 at 2:10 PM, 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"><span class="gmail-"><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 10:03 PM, Eliot Miranda </span><span dir="ltr" style="font-family:arial,sans-serif;color:rgb(34,34,34)"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span><span style="font-family:arial,sans-serif;color:rgb(34,34,34)"> wrote:</span><br></div></span><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-"><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 class="gmail_quote"><span class="gmail-m_-3280637990342992013gmail-"><div><br></div></span><div>I'm modifying the Spur VM to fail becomeForward: when copyHash is true and the target object is immutable.  So when we have immutable literals, #normal would be immutable and the become would fail. </div></div></div></div></blockquote><div><br></div></span><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​+1​</div><span class="gmail-"><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 class="gmail_quote"><div></div><div>However, it seems to me that becomerForward: doing a copyHash is itself a bug.  What's the rationale for copying the receiver's hash to the target object?  I've seen various frameworks use become to clean-up objects by doing aNoLongerWantedObject becomeFor4ward: nil, and with our current default implementation for becomeForward: that will cause havoc.</div></div></div></div></blockquote><div><br></div></span><div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​Well, it would mean nil's identityHash changes. But since nil isn't typically used as key in hashed collections, that use may be fine?</div></div></div></div></div></blockquote><div><br></div><div>Maybe but in Spur I doubt it :-)</div><div><br></div><div>#(nil false true) collect: [:ea| ea identityHash]  #(1 2 3)</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 class="gmail_quote"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial,sans-serif">I agree that the becomeForward: default should be to not copy the hash. This could be done in the image though, no need to change the primitive.</span><br></div></div></div></div></blockquote><div><br></div><div>Changing the primitive is not an option as it breaks VM backward compatibility.  But adding another primitive that implements the desired default is quite straight-forward and then the image can use whichever it chooses without having to add another indirection.</div><div><br></div></div><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>