From: dementiev.vm@... Date: 2020-10-13T13:13:37+00:00 Subject: [ruby-core:100390] [Ruby master Feature#17260] Promote pattern matching to official feature Issue #17260 has been updated by palkan (Vladimir Dementyev). ktsj (Kazuki Tsujimoto) wrote: > I propose to promote pattern matching to official feature. > > The current specification is basically fine I have a little concern regarding the potential changes to the current specification that we might need to introduce to improve the performance. Recently, we introduced a [deconstructed value caching for array patterns](https://github.com/ruby/ruby/pull/3104), which broke the previous non-documented behaviour: it was possible to return different values for `#deconstruct` call within the same `case..in` statement. Now this is fixed (and the performance is improved). We still have the same behaviour for #deconstruct_keys (it's possible return different value for two subsequent calls of `#deconstruct_keys([:a])` within the same `case..in`). I believe, that for the future optimizations of hash patterns (or even more serious internal refactoring for the performance sake), we need to "fix" this edge case as well. So, my question is: will promoting pattern matching make it harder to introduce breaking changes (even for non-documented edge cases)? And if so, don't we need to make the specification complete first, without such gray zones? ---------------------------------------- Feature #17260: Promote pattern matching to official feature https://bugs.ruby-lang.org/issues/17260#change-88003 * Author: ktsj (Kazuki Tsujimoto) * Status: Open * Priority: Normal * Target version: 3.0 ---------------------------------------- I propose to promote pattern matching to official feature. The current specification is basically fine, but I'd like to reconsider single line pattern matching (`expr in pat`) and suggest removing it once in 3.0. -- https://bugs.ruby-lang.org/ Unsubscribe: