Em 23-09-2015 15:53, andrew / avit.ca escreveu:
> Issue #11473 has been updated by Andrew Vit.
>
>
> Hi Rodrigo, I think you need to look into the implications of what you are proposing here.
>
> For example: In one place you use the string literal "name" e.g. `@db_columns = ["name"]`. In a different context you perform `"name" << ",email"` for a different purpose. If these become unfrozen instances of the same object, then both would be mutated unintentionally. This is why "unfreeze" does not exist.

I tried to reply in Redmine but got an Application Error, so let me 
answer by e-mail:

I understand that but unfreeze would only be called for strings which 
haven't been explicitly frozen by the users by calling "name".freeze. 
For those cases there won't be any unfreezing. Actually "unfreeze" won't 
be exposed publicly, but would only be used internally by Ruby when it 
detects the String was frozen by default and there's an attempt to 
change it, just to keep backwards compatibility transparently. After 
all, this is how it currently works if you try to do ["name"].first <<  
',email'.

Implementing what I suggested won't introduce any subtle bugs, it will 
only warrant backward compatibility while allowing strings to be frozen 
by default until the first time there's an attempt to mutate them.

Cheers,
Rodrigo.