Miguel A Salinas II
2018-10-23 11:46:55 UTC
Hi all,
I’m wondering where to pitch an idea and implementation of a new warning. I found that new ruby programmers get confused between strings and symbols especially when using them as keys in hashes. I made a small change that warns when there is a value in the hash with a symbol as its key but you are trying to access it with the equivalent string. E.g.
hash = {this: “that”}
puts hash[“this”]
Warning: no value stored for key “this”. Value found for equivalent symbol key :this. Did you mean to use a symbol?
Any pointers for how to propose this would be greatly appreciated. Thanks!
- miguel
Unsubscribe: <mailto:ruby-talk-***@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/opt
I’m wondering where to pitch an idea and implementation of a new warning. I found that new ruby programmers get confused between strings and symbols especially when using them as keys in hashes. I made a small change that warns when there is a value in the hash with a symbol as its key but you are trying to access it with the equivalent string. E.g.
hash = {this: “that”}
puts hash[“this”]
Warning: no value stored for key “this”. Value found for equivalent symbol key :this. Did you mean to use a symbol?
Any pointers for how to propose this would be greatly appreciated. Thanks!
- miguel
Unsubscribe: <mailto:ruby-talk-***@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/opt