From: Brian Candler Date: 2010-07-14T17:13:38+09:00 Subject: Re: Shouldn't this be called a global constant? Colin Bartlett wrote: > The following is intended to test my understanding, and any corrections > are > welcome. > > 1. A constant has a "constant" reference to an object. You can change > the > "internal" state of that object, and Ruby won't object or warn you. > > 2. Ruby lets you change the object that a constant "refers to", albeit > with > a warning. > > irb > CK = "actor" #=> "actor" > CK << " - Salome" #=> "actor - Salome" > CK = "actress" #=> warning: already initialized constant CK > #=> "actress" Yes, that's all correct. String#replace and File#reopen are useful in these cases. -- Posted via http://www.ruby-forum.com/.