Forum: Ruby-core [ruby-trunk - Feature #7418][Open] Kernel#used_refinements

Bcb6acc9d0d9bef99e033b36c3d32ca9?d=identicon&s=25 charliesome (Charlie Somerville) (Guest)
on 2012-11-21 12:17
(Received via mailing list)
Issue #7418 has been reported by charliesome (Charlie Somerville).

----------------------------------------
Feature #7418: Kernel#used_refinements
https://bugs.ruby-lang.org/issues/7418

Author: charliesome (Charlie Somerville)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:


I'd like to propose a method that returns an array of all refinements
visible from the current scope. I have documented the ordering of the
return array as undefined to allow a bit of flexibility in how it is
implemented across the various Ruby implementations.

One of the criticisms of refinements is that its use makes code harder
to understand - especially when non-lexical refinements are being used.
This method slightly improves the situation by making debugging of code
using refinements easier.

I've named the method 'used_refinements' for now, but I'm open to
changing that to something else.

I've already done the initial implementation which is attached as a
patch. Feedback would be most appreciated.
B397b498cc02503a2d86c86176f7fd3e?d=identicon&s=25 Magnus Holm (judofyr)
on 2012-11-21 14:49
(Received via mailing list)
Maybe it should be called Module.refinements (a la Module.nesting).

// Magnus Holm


On Wed, Nov 21, 2012 at 12:16 PM, charliesome (Charlie Somerville)
C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 shugo (Shugo Maeda) (Guest)
on 2012-11-22 05:23
(Received via mailing list)
Issue #7418 has been updated by shugo (Shugo Maeda).

Status changed from Open to Assigned
Assignee set to shugo (Shugo Maeda)

judofyr (Magnus Holm) wrote:
> Maybe it should be called Module.refinements (a la Module.nesting).

Module.refinements conflicts with Module#refinements, which returns
refinements defined in the receiver.

----------------------------------------
Feature #7418: Kernel#used_refinements
https://bugs.ruby-lang.org/issues/7418#change-33462

Author: charliesome (Charlie Somerville)
Status: Assigned
Priority: Normal
Assignee: shugo (Shugo Maeda)
Category:
Target version:


I'd like to propose a method that returns an array of all refinements
visible from the current scope. I have documented the ordering of the
return array as undefined to allow a bit of flexibility in how it is
implemented across the various Ruby implementations.

One of the criticisms of refinements is that its use makes code harder
to understand - especially when non-lexical refinements are being used.
This method slightly improves the situation by making debugging of code
using refinements easier.

I've named the method 'used_refinements' for now, but I'm open to
changing that to something else.

I've already done the initial implementation which is attached as a
patch. Feedback would be most appreciated.
F24ff61beb80aa5f13371aa22a35619c?d=identicon&s=25 mame (Yusuke Endoh) (Guest)
on 2012-11-24 03:53
(Received via mailing list)
Issue #7418 has been updated by mame (Yusuke Endoh).

Target version set to next minor

Shugo, is this feature mandatory for the 2.0.0 refinements?
I'm setting to next minor tentatively.

--
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
Feature #7418: Kernel#used_refinements
https://bugs.ruby-lang.org/issues/7418#change-33752

Author: charliesome (Charlie Somerville)
Status: Assigned
Priority: Normal
Assignee: shugo (Shugo Maeda)
Category:
Target version: next minor


I'd like to propose a method that returns an array of all refinements
visible from the current scope. I have documented the ordering of the
return array as undefined to allow a bit of flexibility in how it is
implemented across the various Ruby implementations.

One of the criticisms of refinements is that its use makes code harder
to understand - especially when non-lexical refinements are being used.
This method slightly improves the situation by making debugging of code
using refinements easier.

I've named the method 'used_refinements' for now, but I'm open to
changing that to something else.

I've already done the initial implementation which is attached as a
patch. Feedback would be most appreciated.
C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 shugo (Shugo Maeda) (Guest)
on 2013-07-02 10:32
(Received via mailing list)
Issue #7418 has been updated by shugo (Shugo Maeda).

Assignee changed from shugo (Shugo Maeda) to matz (Yukihiro Matsumoto)

I'm against adding a new reflection API for refinements into Ruby 2.1.
What do you think of it, Matz?
----------------------------------------
Feature #7418: Kernel#used_refinements
https://bugs.ruby-lang.org/issues/7418#change-40254

Author: charliesome (Charlie Somerville)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category:
Target version: next minor


I'd like to propose a method that returns an array of all refinements
visible from the current scope. I have documented the ordering of the
return array as undefined to allow a bit of flexibility in how it is
implemented across the various Ruby implementations.

One of the criticisms of refinements is that its use makes code harder
to understand - especially when non-lexical refinements are being used.
This method slightly improves the situation by making debugging of code
using refinements easier.

I've named the method 'used_refinements' for now, but I'm open to
changing that to something else.

I've already done the initial implementation which is attached as a
patch. Feedback would be most appreciated.
This topic is locked and can not be replied to.