diff options
author | Jeremy Evans <code@jeremyevans.net> | 2021-05-13 15:31:46 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2021-07-15 09:56:02 -0700 |
commit | fa87f72e1e84e2b55516be188f00434a683b924c (patch) | |
tree | 0c4efbae462e0ebae46447ea0e18bbea4d7821f0 /NEWS.md | |
parent | f1035248af04b2a4d58990740c3f1b840a5eac78 (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.md | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 |