From: Bob Gustafson Date: 2010-04-22T01:26:05+09:00 Subject: Re: Bug? variable changes without assignment Jes炭s Gabriel y Gal叩n wrote: > This is not a bug, it's the way objects and variables work in ruby. > When you do this: > > variable = constant > > you are saying that variable now references the same object that > constant references. So any message sent through variable or constant > is sent to the same string object. If that message is a destructive > message (like []=, or <<, or sub!), the object is changed and both > variables will see the change since they are referencing the same > object. > Ok, good to know that it is not a bug. However, what is the syntax for an assignment where variable and constant do NOT refer to the same object? -- Posted via http://www.ruby-forum.com/.