ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: marcandre-ruby-core@marc-andre.ca
To: ruby-core@ruby-lang.org
Subject: [ruby-core:100392] [Ruby master Feature#17260] Promote pattern matching to official feature
Date: Tue, 13 Oct 2020 16:19:24 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-88005.20201013161924.3007@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-17260.20201011120315.3007@ruby-lang.org

Issue #17260 has been updated by marcandre (Marc-Andre Lafortune).


palkan (Vladimir Dementyev) wrote in #note-7:
> 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).

I'm glad to read this, I asked for [just that](https://bugs.ruby-lang.org/issues/15881) before 👍
It's a perfectly valid constraint IMO.

I wouldn't be worried about the fact that we aren't yet caching `#deconstruct_keys`. I can't think of a valid use case for replying different values. We can document that this constraint is projected in the future.


----------------------------------------
Feature #17260: Promote pattern matching to official feature
https://bugs.ruby-lang.org/issues/17260#change-88005

* 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/

  parent reply	other threads:[~2020-10-13 16:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 12:03 [ruby-core:100371] [Ruby master Feature#17260] Promote pattern matching to official feature kazuki
2020-10-12  1:00 ` [ruby-core:100378] " matz
2020-10-12  6:30 ` [ruby-core:100380] " nobu
2020-10-12  7:17 ` [ruby-core:100381] " matz
2020-10-12  7:45 ` [ruby-core:100382] " nobu
2020-10-12 12:16 ` [ruby-core:100387] " matz
2020-10-12 21:55 ` [ruby-core:100389] " daniel
2020-10-13 13:13 ` [ruby-core:100390] " dementiev.vm
2020-10-13 16:19 ` marcandre-ruby-core [this message]
2020-10-13 16:44 ` [ruby-core:100393] " dementiev.vm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-88005.20201013161924.3007@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).