From: Robert Dober Date: 2007-05-16T20:41:10+09:00 Subject: Re: Why was the "Symbol is a String"-idea dropped? On 5/16/07, Logan Capaldo wrote: > On 5/16/07, Trans wrote: > > > > > > On May 16, 5:44 am, "Sven Suska (enduro)" wrote: > > > Subclassing alone would not be enough, to solve the problem above, > > > also, String#== and Symbol#== would have to be defined such that "a" == :a > > > And also #hash would have to be defined accordingly. > > > > > > Then you would still have the two different kinds of objects ("a" and :a) > > > but they would behave quite the same except for modifying methods. > > > > While I think Symbol probably could use at least few of String's > > manipulation methods, putting that aside, I wonder how it would effect > > things just to make :a == "a" ? > > > Well there is precendent, 2 == 2.0 and so on > On the other hand, what should happen in case statements? Maybe it > would acutally be better to make :a === 'a' but not :a == 'a' > > Honestly I prefer to write case s.to_s when 'a' instead of case s when 'a' but the most explicit way to do this is maybe the most readable case s when :a, 'a' Cheers Robert P.S. Tom is right that was an excellent resum�. R -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw