2009/1/22 Albert Schlef <albertschlef / gmail.com>:
> Stefan Lang wrote:
>> 2009/1/21 RK Sentinel <sentinel.2001 / gmx.com>:
>> > I define a string in one class. Some other class references it, and
>> > modifies it. I (somehow) expected that when another referer modifies the
>> > reference, ruby would automatically dup() the string.
>>
>> This is a well known "problem" with all languages that
>> have mutable strings. The solution is simple:
>
> If I understand the OP correctly, his problem has nothing to do with
> strings.

Sorry, that's plain wrong. He explicitly mentions Strings in several
places. The object that is mutated *is* a String.

> He says he modifies some object ...and to his great surprise the object
> indeed gets modified.

:-)

Cheers

robert

-- 
remember.guy do |as, often| as.you_can - without end