ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: eregontp@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:104503] [Ruby master Bug#17429] Prohibit include/prepend in refinement modules
Date: Sun, 04 Jul 2021 10:35:51 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-92773.20210704103551.12@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-17429.20201223022216.12@ruby-lang.org

Issue #17429 has been updated by Eregon (Benoit Daloze).


I'll mention it here as it may be helpful.
If you want to define the same method in multiple refinements before this is fixed, the current workaround is to use `class_eval/module_eval` inside `refine` and have those shared methods in a String.
Not so pretty, but it works and it's simple.

----------------------------------------
Bug #17429: Prohibit include/prepend in refinement modules
https://bugs.ruby-lang.org/issues/17429#change-92773

* Author: shugo (Shugo Maeda)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
include/prepend in refinement modules has implementation difficulties such as #17007 and #17379, and tends to be misleading like #17374.
How about to prohibit it in future versions?

Method copy like #17380 may be more convenient, but it's confusing to use names include and prepend because semantics is different from the original ones.




-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2021-07-04 10:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23  2:22 [ruby-core:101639] [Ruby master Bug#17429] Prohibit include/prepend in refinement modules shugo
2020-12-23  5:44 ` [ruby-core:101642] " matz
2020-12-23 11:00 ` [ruby-core:101646] " eregontp
2020-12-23 17:04 ` [ruby-core:101663] " marcandre-ruby-core
2020-12-23 19:19 ` [ruby-core:101664] " daniel
2021-01-06  1:49 ` [ruby-core:101943] " merch-redmine
2021-01-13  8:08 ` [ruby-core:102058] " ronnie
2021-01-13 11:49 ` [ruby-core:102059] " eregontp
2021-01-14  3:15 ` [ruby-core:102081] " shugo
2021-01-14 13:34 ` [ruby-core:102093] " daniel
2021-01-20  7:43 ` [ruby-core:102179] " shugo
2021-01-20 10:45 ` [ruby-core:102181] " eregontp
2021-01-22 18:30 ` [ruby-core:102198] " marcandre-ruby-core
2021-01-26  1:47 ` [ruby-core:102247] " shugo
2021-01-29  9:34 ` [ruby-core:102296] " ko1
2021-01-29 12:21 ` [ruby-core:102298] " eregontp
2021-07-04 10:26 ` [ruby-core:104502] " eregontp
2021-07-04 10:35 ` eregontp [this message]
2021-07-20  7:53 ` [ruby-core:104651] " shugo
2021-07-23 10:02 ` [ruby-core:104664] " eregontp
2021-07-26  0:02 ` [ruby-core:104676] " shugo
2021-07-26 11:12 ` [ruby-core:104680] " eregontp
2021-07-26 11:15 ` [ruby-core:104681] " eregontp
2021-07-27  2:37 ` [ruby-core:104690] " shugo
2021-09-10  7:42 ` [ruby-core:105189] " shugo (Shugo Maeda)
2021-09-16 14:09 ` [ruby-core:105302] " mame (Yusuke Endoh)
2021-09-16 14:11 ` [ruby-core:105303] " mame (Yusuke Endoh)
2021-09-17  2:57 ` [ruby-core:105318] " shugo (Shugo Maeda)
2021-09-17  9:48 ` [ruby-core:105326] " shugo (Shugo Maeda)
2021-09-28 23:21 ` [ruby-core:105475] " shugo (Shugo Maeda)
2021-10-21  5:42 ` [ruby-core:105712] " matz (Yukihiro Matsumoto)
2021-10-21  5:43 ` [ruby-core:105713] " shugo (Shugo Maeda)

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-92773.20210704103551.12@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).