[#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:63997] [ruby-trunk - Bug #9898] Keyword argument oddities
From:
nagachika00@...
Date:
2014-07-24 11:51:59 UTC
List:
ruby-core #63997
Issue #9898 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.0.0: DONTNEED, 2.1: REQUIRED to 2.0.0: DONTNEED, 2.1: DONE
Backported into `ruby_2_1` at r46619.
----------------------------------------
Bug #9898: Keyword argument oddities
https://bugs.ruby-lang.org/issues/9898#change-48013
* Author: Brian Shirai
* Status: Closed
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
* Backport: 2.0.0: DONTNEED, 2.1: DONE
----------------------------------------
Case 1: If a method takes a single argument, and the method is called with a keyword splat, the method receives the passed object, not the result of calling `#to_hash` on the object:
~~~ruby
# kw1.rb
def m(a) a end
o = Object.new
def o.to_hash() puts "to_hash"; { a: 1 } end
p m(**o)
~~~
~~~
$ ruby -v kw1.rb
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
to_hash
#<Object:0x007fdee188ab90>
~~~
Would someone please explain why the result of `#to_hash` in not passed to the method?
Case 2: If the method takes a keyword argument, `#to_hash` is called at the send site and at the receiver:
~~~ruby
# kw2.rb
def mk(a:) a end
o = Object.new
def o.to_hash() puts "to_hash"; { a: 1 } end
p mk(**o)
~~~
~~~
$ ruby -v kw2.rb
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
to_hash
to_hash
1
~~~
Would someone please explain why `#to_hash` is called at both the send site and at the receiver?
--
https://bugs.ruby-lang.org/