On Jan 17, 2010, at 6:57 PM, Nicolas Cellier wrote:
But if you really have time to pick an immutability bit in Newspeak, we don't have to care anymore.
Hmm... the code below should even work with immutable strings. I *never* touch the string! I do not even manipulate the literal array via #at:put:... I just become the pointer to an Array generated with {}, which would not be immutable... So I wonder if the immutability solved the problem. (immutable literals do solve many other bugs when the object itself gets modified...).
strange 'hello world' isString ifTrue: ['hello world' become: {0}]. 'hello world' at: 1 put: ('hello world' at:1) + 1 . ^'hello world' at: 1.
Marcus -- Marcus Denker -- http://www.marcusdenker.de INRIA Lille -- Nord Europe. Team RMoD.