[#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:98824] [Ruby master Bug#11669] inconsitent behavior of refining frozen class
From:
jean.boussier@...
Date:
2020-06-16 10:09:54 UTC
List:
ruby-core #98824
Issue #11669 has been updated by byroot (Jean Boussier).
> How about to simply prohibit `refine` on frozen class?
Conceptually that sounds weird. Freezing a class is to prevent it from being mutated, but refinements are supposed to be a way to extend a class for yourself without mutating it.
----------------------------------------
Bug #11669: inconsitent behavior of refining frozen class
https://bugs.ruby-lang.org/issues/11669#change-86187
* Author: naruse (Yui NARUSE)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* ruby -v: ruby 2.3.0dev (2015-10-26 trunk 52291) [x86_64-darwin15]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Is this expected behavior?
```ruby
class C
def foo
p 1
end
end
module Foo
refine C do
def foo
p 2
end
end
end
using Foo
C.new.foo #=> 2
C.freeze
module Foo
refine C do
def foo
p 3
end
def bar #=> can't modify frozen class (RuntimeError)
p 3
end
end
end
C.new.foo
C.new.bar
```
```
ruby 2.3.0dev (2015-10-26 trunk 52291) [x86_64-darwin15]
2
test.rb:21:in `block in <module:Foo>': can't modify frozen class (RuntimeError)
from test.rb:17:in `refine'
from test.rb:17:in `<module:Foo>'
from test.rb:16:in `<main>'
```
--
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>