[#81999] [Ruby trunk Bug#13737] "can't modify frozen String" when installing bundled gems — ko1@...
Issue #13737 has been updated by ko1 (Koichi Sasada).
4 messages
2017/07/11
[#82005] [Ruby trunk Bug#13737] "can't modify frozen String" when installing bundled gems — nobu@...
Issue #13737 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/07/12
[#82102] Re: register_fstring_tainted:FL_TEST_RAW(str, RSTRING_FSTR) — Eric Wong <normalperson@...>
Koichi Sasada <ko1@atdot.net> wrote:
4 messages
2017/07/18
[#82151] [Ruby trunk Feature#13637] [PATCH] tool/runruby.rb: test with smallest possible machine stack — Rei.Odaira@...
Issue #13637 has been updated by ReiOdaira (Rei Odaira).
3 messages
2017/07/24
[ruby-core:82066] Re: [ruby-cvs:66506] mrkn:r59328 (trunk): hash.c: Add Hash#transform_keys and Hash#transform_keys!
From:
Kazuki Yamaguchi <k@...>
Date:
2017-07-14 10:25:45 UTC
List:
ruby-core #82066
On Fri, Jul 14, 2017 at 03:44:00PM +0900, mrkn@ruby-lang.org wrote:
> mrkn 2017-07-14 15:44:00 +0900 (Fri, 14 Jul 2017)
>
> New Revision: 59328
>
> https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59328
>
> Log:
> hash.c: Add Hash#transform_keys and Hash#transform_keys!
>
> * hash.c (transform_keys_i, rb_hash_transform_keys): Add Hash#transform_keys.
> [Feature #13583] [ruby-core:81290]
>
> * hash.c (rb_hash_transform_keys_bang): Add Hash#transform_keys!.
> [Feature #13583] [ruby-core:81290]
>
> * test/ruby/test_hash.rb: Add tests for above changes.
Just noticed an edge case where those methods behave differently. Both
behaviors seem reasonable to me, but I think they should be consistent.
$ ruby -e 'h={1=>:a,2=>:b}; p h.transform_keys{|k|k==1 ? 2 : 1}'
{2=>:a, 1=>:b}
$ ruby -e 'h={1=>:a,2=>:b}; p h.transform_keys!{|k|k==1 ? 2 : 1}'
{1=>:a}
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>