One of my first bug in st80 was

strange
    ^('foo' writeStream) nextPutAll: '-bar'; contents.

At that time, writing pastEnd did use become:

But if you really have time to pick an immutability bit in Newspeak,
we don't have to care anymore.

Nicolas

2010/1/17 Marcus Denker <[email protected]>:
>
> On Jan 17, 2010, at 6:30 PM, laurent laffont wrote:
>
>> Hi,
>>
>> Something strange to me:
>>
>> '2' = '2'. -> true  (OK)
>> (2 asString) = (2 asString). -> true  (OK)
>>
>> (2 asString) == (2 asString). -> false  (OK)
>> '2' == '2'. -> true  ?????
>>
>
> Yes, the same string in the same method points to the same entry in the 
> literalframe.
>
> Which explains why this method works:
>
> strange
>        'hello world' isString ifTrue: ['hello world' become: {0}].
>        'hello world' at: 1 put: ('hello world' at:1) + 1 .
>        ^'hello world'  at: 1.
>
> Put this method in Object, than print multiple times:
>
>        Object new strange
>
> :-)
>
> --
> Marcus Denker  -- http://www.marcusdenker.de
> INRIA Lille -- Nord Europe. Team RMoD.
>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to