Charles Oliver Nutter wrote:
> Yukihiro Matsumoto wrote:
>>   * so, Symbols are now immutable, interned strings, with some
>>     performance enhancement.
>>
> 
> This seems to raise a red flag for me. String, the superclass, will be 
> mutable, and has mutating methods on it like << and reverse!. Now Symbol 
> will be a subclass of String, but it will not fulfill several of 
> String's promises. Symbol will be kind_of? String, but you can't << or 
> reverse! it. Moreover, this seems to be anti-OO...the contract of the 
> superclass is not being maintained by the subclass. By asserting that 
> Symbol is immutable, you are automatically saying it is not String, 
> since all Strings are mutable.

Fair enough if Symbols are more like Strings that have identity, but 
what of the narrowing of String's abilities in the Symbol subclass? If 
Symbol "is a" String, why will so many of String's methods be 
immediately unavailable?

They seem very separate and distinct to me, other than the fact that 
Symbol often represents itself as a character sequence.

-- 
Charles Oliver Nutter, JRuby Core Developer
headius / headius.com -- charles.o.nutter / sun.com
Blogging at headius.blogspot.com