<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Jul 29, 2008 at 2:11 PM, Hans-Martin Mosner <span dir="ltr">&lt;<a href="mailto:hmm@heeg.de">hmm@heeg.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Philippe Marschall schrieb:<br>
<div><div></div><div class="Wj3C7c">&gt; 2008/7/29 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
&gt;<br>
&gt;&gt; On Tue, Jul 29, 2008 at 1:03 PM, Janko Mivšek &lt;<a href="mailto:janko.mivsek@eranova.si">janko.mivsek@eranova.si</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi Eliot,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Does that mean that you are introducing immutability in new Squeak VM you<br>
&gt;&gt;&gt; are working on? Well, that would be really nice!<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; I think that&#39;s up to the community.<br>
&gt;&gt;<br>
&gt;<br>
&gt; Wouldn&#39;t that break a lot of code? Like anything that does WriteStream<br>
&gt; on a String like #streamContents: ?<br>
&gt;<br>
</div></div>No, unless you&#39;re doing WriteStream on: &#39;&#39; which you should not do anyway.<br>
Normal Strings (those that are created with #new: or with copying) are<br>
mutable, just as they are now.<br>
In general, any code that breaks when the immutability of literals is<br>
ensured by the VM was broken to begin with...<br></blockquote><div><br></div><div>+1.</div><div><br></div><div>Its trivial to fix such code. &nbsp;e.g. if you have</div><div>&nbsp;&nbsp; &nbsp; &nbsp;(ReadWriteStream with: &#39;The date is &#39;) print: Date today; contents</div>
<div>you simply change it to</div>&nbsp;&nbsp; &nbsp; &nbsp;(ReadWriteStream with: &#39;The date is &#39; copy) print: Date today; contents</div><div class="gmail_quote">and you&#39;re done.</div><div class="gmail_quote"><br></div><div class="gmail_quote">
Some developers in the VW community complained when we introduced immutability in 2002 about exactly these cases. &nbsp;But the fuss soon died down as people realised that indeed their code was safer with the change.<br><div>&nbsp;</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div></div>
Cheers,<br>
<font color="#888888">Hans-Martin<br>
<br>
</font></blockquote></div><br></div>