[前][次][番号順一覧][スレッド一覧]

ruby-changes:70324

From: Kazuki <ko1@a...>
Date: Sun, 19 Dec 2021 21:39:02 +0900 (JST)
Subject: [ruby-changes:70324] 3f2b581840 (master): Add news about allowing omission of parentheses in one-line pattern matching

https://git.ruby-lang.org/ruby.git/commit/?id=3f2b581840

From 3f2b58184060b9f0c93327ccb422686368930d33 Mon Sep 17 00:00:00 2001
From: Kazuki Tsujimoto <kazuki@c...>
Date: Sun, 19 Dec 2021 21:37:08 +0900
Subject: Add news about allowing omission of parentheses in one-line pattern
 matching

---
 NEWS.md | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/NEWS.md b/NEWS.md
index 2cdd032c427..ee4b862bd56 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -34,6 +34,16 @@ Note that each entry is kept to a minimum, see links for details. https://github.com/ruby/ruby/blob/trunk/NEWS.md#L34
 
 *   One-line pattern matching is no longer experimental.
 
+*   Parentheses can be omitted in one-line pattern matching.
+    [[Feature #16182]]
+
+    ```ruby
+    [0, 1] => _, x
+    {y: 2} => y:
+    x #=> 1
+    y #=> 2
+    ```
+
 *   Multiple assignment evaluation order has been made consistent with
     single assignment evaluation order.  With single assignment, Ruby
     uses a left-to-right evaluation order.  With this code:
@@ -552,6 +562,7 @@ See [the repository](https://github.com/ruby/error_highlight) in detail. https://github.com/ruby/ruby/blob/trunk/NEWS.md#L562
 [Feature #15912]: https://bugs.ruby-lang.org/issues/15912
 [Feature #16043]: https://bugs.ruby-lang.org/issues/16043
 [Feature #16806]: https://bugs.ruby-lang.org/issues/16806
+[Feature #16182]: https://bugs.ruby-lang.org/issues/16182
 [Feature #17312]: https://bugs.ruby-lang.org/issues/17312
 [Feature #17327]: https://bugs.ruby-lang.org/issues/17327
 [Feature #17370]: https://bugs.ruby-lang.org/issues/17370
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]