[#62904] [ruby-trunk - Feature #9894] [Open] [RFC] README.EXT: document rb_gc_register_mark_object — normalperson@...
Issue #9894 has been reported by Eric Wong.
3 messages
2014/06/02
[#63321] [ANN] ElixirConf 2014 - Don't Miss Jos辿 Valim and Dave Thomas — Jim Freeze <jimfreeze@...>
Just a few more weeks until ElixirConf 2014!
6 messages
2014/06/24
[#63391] Access Modifiers (Internal Interfaces) — Daniel da Silva Ferreira <danieldasilvaferreira@...>
Hi,
3 messages
2014/06/28
[ruby-core:63085] [ruby-trunk - Feature #9929] [Open] add with_default method to Hash
From:
andrew@...
Date:
2014-06-11 00:08:13 UTC
List:
ruby-core #63085
Issue #9929 has been reported by Andrew Brown.
----------------------------------------
Feature #9929: add with_default method to Hash
https://bugs.ruby-lang.org/issues/9929
* Author: Andrew Brown
* Status: Open
* Priority: Normal
* Assignee:
* Category:
* Target version:
----------------------------------------
I would like to be able to write this:
~~~
people.group_by(:first_name).with_default { [] }
~~~
instead of:
~~~
hash = people.group_by(:first_name)
hash.default_proc = proc { [] }
~~~
or, perhaps:
~~~
people.group_by(:first_name).tap { |hash| hash.default_proc = proc { [] } }
~~~
Just wondering if anyone else would be interested in a change like this. I posted a pull request in Rails for an ActiveSupport core extension that does the same thing but would love to see it in Ruby proper. (Pull request is at https://github.com/rails/rails/pull/15626)
--
https://bugs.ruby-lang.org/