This would only be feasible if frozen strings would truly be frozen. Curren=
tly, there are a lot of C extensions modifying frozen strings (which is why=
 Rubinius and JRuby have to treat frozen strings as mutable). Unfortunately=
, the current C API gives access to the raw character array, making it impo=
ssible to prevent frozen strings from being modified. What if a cached, fro=
zen string is modified? Also, I see it as a feature of symbols that they ar=
e not encoding aware.

Konstantin

On Aug 16, 2011, at 17:07 , Magnus Holm wrote:

> On Tue, Aug 16, 2011 at 17:01, Haase, Konstantin
> <Konstantin.Haase / student.hpi.uni-potsdam.de> wrote:
>> What would ObjectSpace.each_object(String) { |o| p o } produce?
>=20
> All the strings (including frozen ones).
>=20
>> It would also largely violate the Liskov substitution principle. Having =
a common superclass or String being the subclass for Symbol should be possi=
ble, though.
>>=20
>> Konstantin
>=20
> The proposal is to remove the Symbol class altogether. :foo becomes
> simply a shortcut for string_cache['foo'] and is *always* a frozen
> String.
>=20