<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Jul 29, 2008 at 2:11 PM, Hans-Martin Mosner <span dir="ltr"><<a href="mailto:hmm@heeg.de">hmm@heeg.de</a>></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">> 2008/7/29 Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>>:<br>
><br>
>> On Tue, Jul 29, 2008 at 1:03 PM, Janko Mivšek <<a href="mailto:janko.mivsek@eranova.si">janko.mivsek@eranova.si</a>><br>
>> wrote:<br>
>><br>
>>> Hi Eliot,<br>
>>><br>
>>> Does that mean that you are introducing immutability in new Squeak VM you<br>
>>> are working on? Well, that would be really nice!<br>
>>><br>
>><br>
>> I think that's up to the community.<br>
>><br>
><br>
> Wouldn't that break a lot of code? Like anything that does WriteStream<br>
> on a String like #streamContents: ?<br>
><br>
</div></div>No, unless you're doing WriteStream on: '' 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. e.g. if you have</div><div> (ReadWriteStream with: 'The date is ') print: Date today; contents</div>
<div>you simply change it to</div> (ReadWriteStream with: 'The date is ' copy) print: Date today; contents</div><div class="gmail_quote">and you'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. But the fuss soon died down as people realised that indeed their code was safer with the change.<br><div> </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>