[squeak-dev] Immutability (was Re: About String vs Symbols)

Hans-Martin Mosner hmm at heeg.de
Tue Jul 29 21:11:09 UTC 2008


Philippe Marschall schrieb:
> 2008/7/29 Eliot Miranda <eliot.miranda at gmail.com>:
>   
>> On Tue, Jul 29, 2008 at 1:03 PM, Janko Mivšek <janko.mivsek at eranova.si>
>> wrote:
>>     
>>> Hi Eliot,
>>>
>>> Does that mean that you are introducing immutability in new Squeak VM you
>>> are working on? Well, that would be really nice!
>>>       
>>
>> I think that's up to the community.
>>     
>
> Wouldn't that break a lot of code? Like anything that does WriteStream
> on a String like #streamContents: ?
>   
No, unless you're doing WriteStream on: '' which you should not do anyway.
Normal Strings (those that are created with #new: or with copying) are
mutable, just as they are now.
In general, any code that breaks when the immutability of literals is
ensured by the VM was broken to begin with...

Cheers,
Hans-Martin



More information about the Squeak-dev mailing list