aboutsummaryrefslogtreecommitdiffstats
path: root/NEWS.md
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2020-06-14 09:24:36 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2020-06-14 09:24:36 +0900
commitddded1157a90d21cb54b9f07de35ab9b4cc472e1 (patch)
tree315005f4eead6840846e6ce4bbd4dfa44c3bfce7 /NEWS.md
parentf7906a7e31e6b1cfa135ecea69deb8827e8c8803 (diff)
downloadruby-ddded1157a90d21cb54b9f07de35ab9b4cc472e1.tar.gz
Introduce find pattern [Feature #16828]
Diffstat (limited to 'NEWS.md')
-rw-r--r--NEWS.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/NEWS.md b/NEWS.md
index 6856a29517..8b92aa45b0 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -38,6 +38,18 @@ sufficient information, see the ChangeLog file or Redmine
instead of a warning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJumpError. [[Feature #15575]]
+* Find pattern is added. [[Feature #16828]]
+
+ ```ruby
+ case ["a", 1, "b", "c", 2, "d", "e", "f", 3]
+ in [*pre, String => x, String => y, *post]
+ p pre #=> ["a", 1]
+ p x #=> "b"
+ p y #=> "c"
+ p post #=> [2, "d", "e", "f", 3]
+ end
+ ```
+
* Rightward assignment statement is added. [EXPERIMENTAL]
[[Feature #15921]]