[#76442] [Ruby trunk Feature#11741] Migrate Ruby to Git from Subversion — naruse@...
Issue #11741 has been updated by Yui NARUSE.
3 messages
2016/07/19
[#76515] [Ruby trunk Bug#12610] webrick: protect from httpoxy — nagachika00@...
Issue #12610 has been updated by Tomoyuki Chikanaga.
3 messages
2016/07/22
[ruby-core:76401] [Ruby trunk Bug#10837] spatting a single element array produces an array instead of a single value for return and next
From:
najamelan@...
Date:
2016-07-18 17:58:52 UTC
List:
ruby-core #76401
Issue #10837 has been updated by Naja Melan.
@bug hit
My apologies, it seems I'm mistaken. The splat operator does not just seem to coerce into array for all types:
~~~ ruby
a = { a: 1 }
p [a] # [{:a=>1}]
p *a # [:a, 1]
p [*a] # [[:a, 1]]
~~~
It seems it calls `#to_a` on classes that implement this. I'm sorry if I create confusion in the ongoing discussion.
----------------------------------------
Bug #10837: spatting a single element array produces an array instead of a single value for return and next
https://bugs.ruby-lang.org/issues/10837#change-59643
* Author: bug hit
* Status: Rejected
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
irb(main):013:0> ->{return *[1]}.()
=> [1]
irb(main):014:0> ->{next *[1]}.()
=> [1]
______________
*[x] should mean x as it already does for arguments
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>