[#98621] Re: Function getlogin_r()'s protoype] — Bertram Scharpf <lists@...>
FYI,
3 messages
2020/06/02
[#98947] [Ruby master Feature#16986] Anonymous Struct literal — ko1@...
Issue #16986 has been reported by ko1 (Koichi Sasada).
66 messages
2020/06/26
[#98962] [Ruby master Bug#16988] Kernel.load loads file from current directory without '.' in path — misharinn@...
Issue #16988 has been reported by TheSmartnik (Nikita Misharin).
5 messages
2020/06/26
[#98969] [Ruby master Feature#16994] Sets: shorthand for frozen sets of symbols / strings — marcandre-ruby-core@...
Issue #16994 has been reported by marcandre (Marc-Andre Lafortune).
7 messages
2020/06/26
[#100117] [Ruby master Feature#16994] Sets: shorthand for frozen sets of symbols / strings
— matz@...
2020/09/25
Issue #16994 has been updated by matz (Yukihiro Matsumoto).
[ruby-core:98611] [Ruby master Bug#14671] Refining Module#refine itself introduces strange state
From:
merch-redmine@...
Date:
2020-06-01 17:35:38 UTC
List:
ruby-core #98611
Issue #14671 has been updated by jeremyevans0 (Jeremy Evans).
Status changed from Open to Rejected
This is because Class undefs `refine`, and the refinement for Module is after the lookup chain for Class. Your code works fine if you call `refine` on a Module and not a Class, or if you remove the `undef` from Class. Ruby does not support directly removing an `undef` through `remove_method`, but you can override the method and remove the overridden method. This code:
```ruby
using Module.new {
refine Module do
def refine *;
puts self
end
public :refine
end
}
Enumerable.refine
Class.define_method(:refine){}
Class.remove_method(:refine)
Object.refine
```
prints:
```
Enumerable
Object
```
Your code also works if you refine Class instead of Module.
----------------------------------------
Bug #14671: Refining Module#refine itself introduces strange state
https://bugs.ruby-lang.org/issues/14671#change-85933
* Author: shyouhei (Shyouhei Urabe)
* Status: Rejected
* Priority: Normal
* ruby -v: ruby 2.6.0dev (2018-04-09 trunk 63122) [x86_64-darwin15]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
```ruby
using Module.new {
refine Module do
def refine *;
puts self
end
public :refine
end
}
Object.refine # => NoMethodError
```
It is possible to refine Module#refine, but there seems to be no way to call it.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>