From: Gennady Bystritsky Date: 2009-12-22T10:38:55+09:00 Subject: Re: Symbols vs. constants? On Dec 21, 2009, at 5:15 PM, Young H. wrote: > On Tue, Dec 22, 2009 at 9:07 AM, Gennady Bystritsky > wrote: >> Constants are variables that can be assigned to any object (only once). > > Hi, > > It seems to me a constant can be changed during the runtime. > >> Z="hello" > => "hello" >> Z=1234 > (irb):11: warning: already initialized constant Z > => 1234 >> Z > => 1234 > > So does it mean, it can be changed, but not encouraged? You may say so. I just did not want to bring it up for simplicity sake. For me any warning produced by my code must be fixed, and in this case the fix would be to check that constants are assigned only once. I personally would prefer an exception for such cases. Gennady.