Actions
Feature #8939
closedsymbol / string invariance (for hashes)
Status:
Closed
Assignee:
-
Target version:
-
Description
hash={key:"value"}
hash["key"] should return "value"
hash={"key"=>"value"}
hash[:key] should return "value"
Updated by Hanmac (Hans Mackowiak) about 11 years ago
no it should not because Symbol and String are two different Classes,
if you want that are the same use ActiveSupport::HashWithIndifferentAccess
Updated by Sing9898 (Sing Lou) about 11 years ago
Update: then let's make HashWithIndifferentAccess the standard hash somehow
Updated by Hanmac (Hans Mackowiak) about 11 years ago
Duplicate of Feature #7797 "Hash should be renamed to StrictHash and a new Hash should be created to behave like AS HashWithIndifferentAccess"
others like
Feature #7792 "Make symbols and strings the same thing"
are rejected
you RailsGuys need to understand that there are both String and Symbol and both does have pro and con facts
(always turning sym <-> str is not a good idea)
Updated by Sing9898 (Sing Lou) about 11 years ago
yes,duplicate, thanks
Updated by nagachika (Tomoyuki Chikanaga) about 11 years ago
- Status changed from Open to Closed
Actions
Like0
Like0Like0Like0Like0Like0