On Sun, Feb 04, 2007 at 04:49:08AM +0900, Trans wrote: > > > On Feb 3, 2:17 pm, gwtm... / mac.com wrote: > > On Feb 3, 2007, at 12:12 PM, Trans wrote: > > > > > Though it will undoubtedly be less useful in Ruby 2.0 when > > > string and symbol hash keys key for the same entry, it is still useful > > > in other ways. > > > > I seem to remember that matz backed off from this idea. > > I think he backed off making Symbol a subclass of String, but I think > he's still considering auto-coercing symbol to string, or at the very > least that they will have some sort of equality for use as hash keys. > Matz? > Incidently, I'd like to point out why I think that's an especially bad idea (only equivalent in hashes) ["foo", :foo, 2].uniq #=> ["foo", 2] [1, 1.0, 2].uniq #=> [1, 1.0, 2] But; 1 == 1.0 and :foo != "foo" (at least if the equality _only_ applies in hashes, in #hash and #eql? IOW). I find it very "warty". > T. >