[#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 <[email protected]>
[ruby-core:64028] [ruby-trunk - Feature #9980] [Rejected] Create HashWithIndiferentAccess using new syntax {a: 1}i
From:
matz@...
Date:
2014-07-26 05:12:17 UTC
List:
ruby-core #64028
Issue #9980 has been updated by Yukihiro Matsumoto.
Status changed from Open to Rejected
Suffix `i` is used for complex (imaginary) numbers. It's bit confusing.
Maybe what you want can be gained by shorter/nicer name for Hash#compare_by_identity.
Matz.
----------------------------------------
Feature #9980: Create HashWithIndiferentAccess using new syntax {a: 1}i
https://bugs.ruby-lang.org/issues/9980#change-48041
* Author: Rodrigo Rosenfeld Rosas
* Status: Rejected
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* Category: syntax
* Target version: current: 2.2.0
----------------------------------------
This is related to feature #7797. For that feature I requested a regular hash ({}) to be treated as HWIA and the current hash implementation would be available as StrictHash.new since it's not as much needed as the common case of expecting a[:a] to be the same as a['a'].
Although I still prefer the proposal in #7797, I'd like to propose an alternative syntax for a new implementation of Hash that converts symbols to strings in keys (or keys to strings, it doesn't matter). This:
~~~
{my_key: 'my_value'}i
~~~
Should be equivalent to:
~~~
HashWithIndifferentAccess.new(my_key: 'my_value') # from ActiveSupport
~~~
It doesn't have to behave exactly like the implementation from ActiveSupport. I only really care about symbols and strings being treated the same way.
This is not as great as #7797 because it will only affect user's own code rather than hashes created by other libraries (unless they decide to adopt the new syntax, which could take quite a while to keep backward compatibility with old Ruby versions). But it would already make it way more pleasant to define new hashes with indifferent access.
Maybe it could act recursively during the hash creation, but I'm fine if you think it would be more confusing than helpful. To illustrate:
~~~
{a: {b: 1}}i
~~~
could mean the same as:
~~~
{a: {b: 1}i}i
~~~
---Files--------------------------------
feature-9980.pdf (24.8 KB)
--
https://bugs.ruby-lang.org/