[#69084] [Ruby trunk - Feature #11124] [Open] [PATCH] lib/*: use monotonic clock for timeouts — normalperson@...
Issue #11124 has been reported by Eric Wong.
5 messages
2015/05/06
[#69138] [Ruby trunk - Feature #11136] [PATCH] webrick: avoid fcntl module — nobu@...
Issue #11136 has been updated by Nobuyoshi Nakada.
3 messages
2015/05/12
[#69160] [Ruby trunk - Feature #11146] [PATCH] variable.c: initialize generic_iv_tbl at start — nobu@...
Issue #11146 has been updated by Nobuyoshi Nakada.
4 messages
2015/05/13
[#69175] Re: [Ruby trunk - Feature #11146] [PATCH] variable.c: initialize generic_iv_tbl at start
— Eric Wong <normalperson@...>
2015/05/13
nobu@ruby-lang.org wrote:
[ruby-core:69099] [Ruby trunk - Bug #11129] block-level hash destructuring only works for the last argument
From:
shibata.hiroshi@...
Date:
2015-05-08 06:10:40 UTC
List:
ruby-core #69099
Issue #11129 has been updated by Hiroshi SHIBATA.
Subject changed from each_with_index doesn't work with block-level hash destructuring to block-level hash destructuring only works for the last argument
----------------------------------------
Bug #11129: block-level hash destructuring only works for the last argument
https://bugs.ruby-lang.org/issues/11129#change-52343
* Author: Sean Linsley
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: 2.2
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
```ruby
[{a: 2}].each_with_index{ |a:, index| }
SyntaxError: unexpected tIDENTIFIER
[{a: 2}].each_with_index{ |(a:), index| }
SyntaxError: unexpected tLABEL
[{a: 2}].each_with_index.map{ |hash, index| [index, hash] }.map{ |index, a:| p [index, a] }
== [0, 2]
```
It seems like the second example should work, in the same way that parentheses in `||` destructure arrays.
--
https://bugs.ruby-lang.org/