From: Dave Thomas Date: 2001-09-19T00:10:58+09:00 Subject: [ruby-talk:21330] Re: const-correctness Paul Brannan writes: > If I do this: > > X = 'this is a test' # this is a const reference to an object > x = X # this is a non-const reference to the same > x << '... testing ...' # let's try and modify a "const" object > p x > p X All you have to do is X = 'test' X << '...' There's no warning there either. In Ruby, constant is an attribute of the name, not the object. 'X' is constant, so if you reassign to it, you get a warning. However, the object the constant references is still capable of receiving messages and changing its contents accordingly. Dave