[#63592] [ruby-trunk - Bug #10009] IO operation is 10x slower in multi-thread environment — normalperson@...
Issue #10009 has been updated by Eric Wong.
3 messages
2014/07/08
[#63682] [ruby-trunk - Feature #10030] [PATCH] reduce rb_iseq_struct to 296 bytes — ko1@...
Issue #10030 has been updated by Koichi Sasada.
3 messages
2014/07/13
[#63703] [ruby-trunk - Feature #10030] [PATCH] reduce rb_iseq_struct to 296 bytes — ko1@...
Issue #10030 has been updated by Koichi Sasada.
3 messages
2014/07/14
[#63743] [ruby-trunk - Bug #10037] Since r46798 on Solaris, "[BUG] rb_vm_get_cref: unreachable" during make — ngotogenome@...
Issue #10037 has been updated by Naohisa Goto.
3 messages
2014/07/15
[#64136] Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb — "Jeffrey 'jf' Lim" <jfs.world@...>
As per subject.
4 messages
2014/07/31
[#64138] Re: Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb
— "Jeffrey 'jf' Lim" <jfs.world@...>
2014/07/31
On Thu, Jul 31, 2014 at 6:03 PM, Jeffrey 'jf' Lim <jfs.world@gmail.com>
[ruby-core:64022] [ruby-trunk - Feature #7797] Hash should be renamed to StrictHash and a new Hash should be created to behave like AS HashWithIndifferentAccess
From:
naruse@...
Date:
2014-07-26 04:47:39 UTC
List:
ruby-core #64022
Issue #7797 has been updated by Yui NARUSE.
File deleted (feature-7797.pdf)
----------------------------------------
Feature #7797: Hash should be renamed to StrictHash and a new Hash should be created to behave like AS HashWithIndifferentAccess
https://bugs.ruby-lang.org/issues/7797#change-48036
* Author: Rodrigo Rosenfeld Rosas
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* Category: core
* Target version: Next Major
----------------------------------------
Since #7792 has been rejected (although I don't really understand the reason except people being afraid of changing I guess) I'd like to propose an alternative solution to most of the problems caused by the differences between symbols and strings.
From my previous experience, most of the time I'm accessing a hash, I'd prefer that it behaved like HashWithIndifferentAccess (HWIA from now) from active_support gem.
Transforming all possible hashes in some object to HWIA is not only boring to do code but also time consuming.
Instead, I propose that {}.class == Hash, with Hash being implemented as HWIA and the current Hash implementation renamed to StrictHash.
That way, this should work:
a = {a: 1, 'b' => 2}
a[:a] == a['a'] && a['b'] == a[:b]
I don't really see any real use case where people really want to have a hash like this:
h = {a: 1, 'a' => 2}
This would only confuse people.
It also avoids confusion when parsing/unparsing from popular serialization formats, like JSON:
currently:
h = {a: 1}
j = JSON.unparse h
h2 = JSON.parse j
h[:a] != h2[:a]
With the new proposition (I'm assuming JSON should use Hash instead of StrictHash when parsing) h[:a] == h2[:a].
This is just a small example but most real-world usage for hashes would benefit from regular hashes behaving like HWIA.
---Files--------------------------------
redmine-bug.jpg (107 KB)
feature-7797.pdf (29.3 KB)
--
https://bugs.ruby-lang.org/