[ruby-talk:02546] Re: frozen behavior

From: matz@... (Yukihiro Matsumoto)
Date: 2000-04-21 09:23:25 UTC
List: ruby-talk #2546
In message "[ruby-talk:02527] Re: frozen behavior"
    on 00/04/20, Dave Thomas <Dave@thomases.com> writes:
|> Hmm, I kinda feel like changing String class is altering the global
|> status.  But the result is almost same as you mentioned.
|
|Even worse - if someone wants to add a method to a particular object,
|and the object is frozen, then they might be tempted to make the more
|global change to the object's class instead. This would be
|bad--changing all objects because you were frustrated while trying to
|change one.
|
|How am I doing?

But someone froze the object to prevent modification of it, so I think
the original intention should be honored.  You can make copy of the
object by using dup (not clone, it copies freezing status too).

							matz.

In This Thread

Prev Next