From: "Haase, Konstantin" Date: 2011-08-17T00:38:58+09:00 Subject: [ruby-core:38985] Re: :symbol.is_a?(String) This would only be feasible if frozen strings would truly be frozen. Currently, 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 impossible to prevent frozen strings from being modified. What if a cached, frozen string is modified? Also, I see it as a feature of symbols that they are not encoding aware. Konstantin On Aug 16, 2011, at 17:07 , Magnus Holm wrote: > On Tue, Aug 16, 2011 at 17:01, Haase, Konstantin > wrote: >> What would ObjectSpace.each_object(String) { |o| p o } produce? > > All the strings (including frozen ones). > >> It would also largely violate the Liskov substitution principle. Having a common superclass or String being the subclass for Symbol should be possible, though. >> >> Konstantin > > The proposal is to remove the Symbol class altogether. :foo becomes > simply a shortcut for string_cache['foo'] and is *always* a frozen > String. >