[ruby-core:113779] [Ruby master Feature#19714] Add Refinement#refined_module

Issue #19714 has been reported by shugo (Shugo Maeda). ---------------------------------------- Feature #19714: Add Refinement#refined_module https://bugs.ruby-lang.org/issues/19714 * Author: shugo (Shugo Maeda) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.3 ---------------------------------------- Eregon (Benoit Daloze) wrote in https://bugs.ruby-lang.org/issues/12737#note-15:
`Refinement#refined_class` is a bit strange given it can return a module. How about adding `Refinement#refined_module` as an alias for clarity?
I'm for it. What do you think, Matz? -- https://bugs.ruby-lang.org/

Issue #19714 has been updated by matz (Yukihiro Matsumoto). I am not 100% satisfied. Probably (unlike `class_eval` and `module_eval` whose class/module distinction is for the receiver), the method returns a class or a module, unrelated to the name. Is there any idea? Matz. ---------------------------------------- Feature #19714: Add Refinement#refined_module https://bugs.ruby-lang.org/issues/19714#change-103558 * Author: shugo (Shugo Maeda) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.3 ---------------------------------------- Eregon (Benoit Daloze) wrote in https://bugs.ruby-lang.org/issues/12737#note-15:
`Refinement#refined_class` is a bit strange given it can return a module. How about adding `Refinement#refined_module` as an alias for clarity?
I'm for it. What do you think, Matz? -- https://bugs.ruby-lang.org/

Issue #19714 has been updated by austin (Austin Ziegler). matz (Yukihiro Matsumoto) wrote in #note-2:
I am not 100% satisfied. Probably (unlike `class_eval` and `module_eval` whose class/module distinction is for the receiver), the method returns a class or a module, unrelated to the name. Is there any idea?
- `#refined_target` - `#refined_subject` - `#refined_receiver` - `#refined_context` The first one I came up with is `#refined_subject` in the same sense as `#subject` in RSpec: http://rspec.info/features/3-12/rspec-core/subject/explicit-subject/ ---------------------------------------- Feature #19714: Add Refinement#refined_module https://bugs.ruby-lang.org/issues/19714#change-103561 * Author: shugo (Shugo Maeda) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.3 ---------------------------------------- Eregon (Benoit Daloze) wrote in https://bugs.ruby-lang.org/issues/12737#note-15:
`Refinement#refined_class` is a bit strange given it can return a module. How about adding `Refinement#refined_module` as an alias for clarity?
I'm for it. What do you think, Matz? -- https://bugs.ruby-lang.org/

Issue #19714 has been updated by matz (Yukihiro Matsumoto). Among those proposed names, `target` and `subject` are acceptable. I am not sure `refined_` prefix required or not, as not being English native. Maybe should we admit the design mistake and make `refined_class` obsolete? Matz. ---------------------------------------- Feature #19714: Add Refinement#refined_module https://bugs.ruby-lang.org/issues/19714#change-103826 * Author: shugo (Shugo Maeda) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.3 ---------------------------------------- Eregon (Benoit Daloze) wrote in https://bugs.ruby-lang.org/issues/12737#note-15:
`Refinement#refined_class` is a bit strange given it can return a module. How about adding `Refinement#refined_module` as an alias for clarity?
I'm for it. What do you think, Matz? -- https://bugs.ruby-lang.org/

Issue #19714 has been updated by shugo (Shugo Maeda). matz (Yukihiro Matsumoto) wrote in #note-4:
Among those proposed names, `target` and `subject` are acceptable. I am not sure `refined_` prefix required or not, as not being English native. Maybe should we admit the design mistake and make `refined_class` obsolete?
I prefer `target` and agree to making `refined_class` obsolete. ---------------------------------------- Feature #19714: Add Refinement#refined_module https://bugs.ruby-lang.org/issues/19714#change-103829 * Author: shugo (Shugo Maeda) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.3 ---------------------------------------- Eregon (Benoit Daloze) wrote in https://bugs.ruby-lang.org/issues/12737#note-15:
`Refinement#refined_class` is a bit strange given it can return a module. How about adding `Refinement#refined_module` as an alias for clarity?
I'm for it. What do you think, Matz? -- https://bugs.ruby-lang.org/

Issue #19714 has been updated by Eregon (Benoit Daloze). Make obsolete = deprecate it, right? (sounds OK) `Refinement#target` sounds good to me. ---------------------------------------- Feature #19714: Add Refinement#refined_module https://bugs.ruby-lang.org/issues/19714#change-103877 * Author: shugo (Shugo Maeda) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.3 ---------------------------------------- Eregon (Benoit Daloze) wrote in https://bugs.ruby-lang.org/issues/12737#note-15:
`Refinement#refined_class` is a bit strange given it can return a module. How about adding `Refinement#refined_module` as an alias for clarity?
I'm for it. What do you think, Matz? -- https://bugs.ruby-lang.org/

Issue #19714 has been updated by shugo (Shugo Maeda). Eregon (Benoit Daloze) wrote in #note-6:
Make obsolete = deprecate it, right? (sounds OK)
I mean to add a warning in 3.3 and remove refined_class in 3.4: https://github.com/ruby/ruby/pull/8075/files ---------------------------------------- Feature #19714: Add Refinement#refined_module https://bugs.ruby-lang.org/issues/19714#change-103881 * Author: shugo (Shugo Maeda) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.3 ---------------------------------------- Eregon (Benoit Daloze) wrote in https://bugs.ruby-lang.org/issues/12737#note-15:
`Refinement#refined_class` is a bit strange given it can return a module. How about adding `Refinement#refined_module` as an alias for clarity?
I'm for it. What do you think, Matz? -- https://bugs.ruby-lang.org/
participants (4)
-
austin (Austin Ziegler)
-
Eregon (Benoit Daloze)
-
matz (Yukihiro Matsumoto)
-
shugo (Shugo Maeda)