<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 12 Mar 2020 at 12:14 pm, Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div id="m_-3750410739132356954__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:#000000">
                                        > <span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">So do I have everyone's consent in changing trunk over to read-only literals?  If there are no strenuous complaints by tomorrow noon, PST, I shall effect the change.</span><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">+1 :-)</span></div></div></div></blockquote><div dir="auto"><br></div><div dir="auto">+1 (we treat them as immutable in GraalSqueak already).</div><div dir="auto"><br></div><div dir="auto">Fabio</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div id="m_-3750410739132356954__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:#000000"><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">Best,</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">Marcel</span></div></div></div><div><div id="m_-3750410739132356954__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:#000000"><div></div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px">
                        <p style="color:#aaaaaa;margin-top:10px">Am 11.03.2020 22:10:56 schrieb Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi All,<div><br></div><div>    I'v committed the core support for read-only objects, adapted from Clément's Pharo implementation.  Enabling read-only literals is a very small step from that (three methods modified in the parser, and one method modified in Symbol class).  I would like to do this as soon as possible, but it may break code.  Hence my asking for permission/sending out a warning before hand.  Note that the only code it will break is bad code; code that writes to literals.</div><div><br></div><div>With the changes installed doing this:</div><div><br></div><div>#(1 2 3) at: 2 put: 'nevermore'<br></div><div><br></div><div>raises a ModificationForbidden exception with the message text "ModificationForbidden:  #(1 2 3) is read-only, hence its field 2 cannot be modified with 'nevermore'"</div><div><br></div><div><br></div><div>When we added read-only object support to VisualWorks some of the engineering staff were of the opinion that insulating customers from the change was a necessary thing, and so we implemented a preference to allow automatic mutating of read-only literals so that customers whose code did modify literals could set the preference rather than fix their code.  I *really* don't ant to do this.  It is a lot of complication for little gain; the right fix is just to rewrite the code not to write to literals.  Note that that's as easy as:</div><div><br></div><div>#(1 2 3) copy at: 2 put: 'nevermore'; yourself</div><div>=></div><div><div>#(1 'nevermore' 3)</div></div><div><br></div><div>since copies of read-only objects are mutable.</div><div><br></div><div>So do I have everyone's consent in changing trunk over to read-only literals?  If there are no strenuous complaints by tomorrow noon, PST, I shall effect the change.</div><div><br></div><div>To avoid recompiling (which can produce unbound methods, etc) I shall change literals to be read-only via a pass over all literals and a pass over the Symbol table.  Hence the change should be non-invasive.  If your code (like probably 99.9% of all code in the system) doesn't write to literals you won't notice.</div><div><br><div dir="ltr"><div dir="ltr"><div><span style="font-size:10pt;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div></div></div></div></div>
</div></blockquote>
                                        </div></div><br>
</blockquote></div></div>