From: Kurt Stephens Date: 2011-08-16T21:20:46+09:00 Subject: [ruby-core:38977] [Ruby 1.9 - Feature #4801] Shorthand Hash Syntax for Strings Issue #4801 has been updated by Kurt Stephens. The most important distinction between Symbols and Strings: a Symbol has the property where its identity *is* its lexical equality where as a String identity is distinct from its equality. The difference has important performance and semantic benefits. Altering Symbol#==(String) to return true where :'foo'.to_s == 'foo' removes this difference. As its namesake implies, a Symbol is an atomic placeholder for a concept, a mnemonic device, where as String is a mutable sequence of characters. Symbols represent concepts; Strings hold data. I agree that Symbols and Strings should cooperate, but altering Symbol#== is not appropriate. Perhaps String#+(Symbol) and String#<<(Symbol) should behave as one might expect. ---------------------------------------- Feature #4801: Shorthand Hash Syntax for Strings http://redmine.ruby-lang.org/issues/4801 Author: Tom Wardrop Status: Open Priority: Normal Assignee: Category: Target version: Assuming there's no technical limitation or ambiguities, I suggest that the shorthand syntax for symbol's in the context of an array, be applied to strings also. E.g. {'key': 'value'} I don't believe there are any syntax ambiguous that this would give rise to. The only consideration that may need to be made, is if there are plans to support shorthand syntax for quoted symbols, e.g. {'key': 'value'}. If quoted symbols are off the table, then there's no harm in implementing a shorthand hash syntax for strings. This may stem the growing problem of what I like to call 'symbolitis' , where symbol's are selected as the key type purely for their aesthetics and ease of use, even when strings are a more appropriate choice. Thoughts? -- http://redmine.ruby-lang.org