From: Albert Schlef Date: 2009-01-22T20:40:10+09:00 Subject: Re: String doesnt auto dup on modification Stefan Lang wrote: > 2009/1/21 RK Sentinel : > > 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. He says he modifies some object ...and to his great surprise the object indeed gets modified. -- Posted via http://www.ruby-forum.com/.