[ruby-talk:02549] Re: frozen behavior

From: Andrew Hunt <andy@...>
Date: 2000-04-21 14:28:09 UTC
List: ruby-talk #2549
    >Is it possible to make String instance frozen be
    >the default?  That is, one has to explicitly 'unfreeze'|'thaw' a string to
    >modify in place. Currently, I have to type a lot 'string'.freeze, and I
    >saw many other ruby programs doing the same thing.

That's sounds pretty painful as the default, I think, and would
likely break every program in existance!

Perhaps a command line flag could freeze strings by default, or
--even better-- if we had access to the String constructor,
you could simply override it in your Ruby program and freeze
all strings by default without breaking any other program.

/\ndy

In This Thread

Prev Next