diff options
author | Kazuki Tsujimoto <kazuki@callcc.net> | 2021-03-21 15:12:54 +0900 |
---|---|---|
committer | Kazuki Tsujimoto <kazuki@callcc.net> | 2021-03-21 15:14:31 +0900 |
commit | 21863470d965b8cc299b1f82417c70d5d26f8ab2 (patch) | |
tree | 727faf202cf818d796602b526e17fb9bfea0cb29 /NEWS.md | |
parent | 232433f22423fb6a3ff7a610140c711a964d3b3d (diff) | |
download | ruby-21863470d965b8cc299b1f82417c70d5d26f8ab2.tar.gz |
Pattern matching pin operator against expression [Feature #17411]
This commit is based on the patch by @nobu.
Diffstat (limited to 'NEWS.md')
-rw-r--r-- | NEWS.md | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -6,6 +6,12 @@ since the **3.0.0** release, except for bug fixes. Note that each entry is kept to a minimum, see links for details. ## Language changes +* Pin operator now takes an expression. [[Feature #17411]] + + ```ruby + Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a + #=> [[3, 5], [5, 7], [11, 13]] + ``` ## Command line options @@ -90,5 +96,6 @@ Excluding feature bug fixes. [Feature #16806]: https://bugs.ruby-lang.org/issues/16806 [Feature #17312]: https://bugs.ruby-lang.org/issues/17312 [Feature #17327]: https://bugs.ruby-lang.org/issues/17327 +[Feature #17411]: https://bugs.ruby-lang.org/issues/17411 [Bug #17423]: https://bugs.ruby-lang.org/issues/17423 [Feature #17479]: https://bugs.ruby-lang.org/issues/17479 |