summaryrefslogtreecommitdiff
path: root/NEWS.md
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-05-13 15:31:46 -0700
committerJeremy Evans <code@jeremyevans.net>2021-07-15 09:56:02 -0700
commitfa87f72e1e84e2b55516be188f00434a683b924c (patch)
tree0c4efbae462e0ebae46447ea0e18bbea4d7821f0 /NEWS.md
parentf1035248af04b2a4d58990740c3f1b840a5eac78 (diff)
Add pattern matching pin support for instance/class/global variables
Pin matching for local variables and constants is already supported, and it is fairly simple to add support for these variable types. Note that pin matching for method calls is still not supported without wrapping in parentheses (pin expressions). I think that's for the best as method calls are far more complex (arguments/blocks). Implements [Feature #17724]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4502
Diffstat (limited to 'NEWS.md')
-rw-r--r--NEWS.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/NEWS.md b/NEWS.md
index 702803eee7..5f0b5a6b2c 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -14,6 +14,13 @@ Note that each entry is kept to a minimum, see links for details.
#=> [[3, 5], [5, 7], [11, 13]]
```
+* Pin operator now supports instance, class, and global variables.
+ [[Feature #17724]]
+
+ @n = 5
+ Prime.each_cons(2).lazy.find{_1 in [n, ^@n]}
+ #=> [3, 5]
+
* 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:
@@ -190,6 +197,7 @@ Excluding feature bug fixes.
[Bug #17423]: https://bugs.ruby-lang.org/issues/17423
[Feature #17479]: https://bugs.ruby-lang.org/issues/17479
[Feature #17490]: https://bugs.ruby-lang.org/issues/17490
+[Feature #17724]: https://bugs.ruby-lang.org/issues/17724
[Feature #17744]: https://bugs.ruby-lang.org/issues/17744
[Feature #17762]: https://bugs.ruby-lang.org/issues/17762
[Bug #18003]: https://bugs.ruby-lang.org/issues/18003