[Some context.](https://bugs.ruby-lang.org/issues/4559#note-13) The current documentation of `Proc#==` in Ruby 4 says `self == other` "returns whether `self` and `other` were created from the same code block." However, the following c...UlyssesZhan (Ulysses Zhan)
I don't know whether this should be the place to discuss it anymore because it is old, but I think currently `Proc#==` still does not match the documented behavior. The current documentation in Ruby 4 says `self == other` "returns whethe...UlyssesZhan (Ulysses Zhan)
I propose an API `Method.new(receiver, name = nil, &block)` to define an anonymous singleton method and `UnboundMethod.new(owner, name = nil, &block)` to define an anonymous instance method. The default value of `name` can be `:anonymous...UlyssesZhan (Ulysses Zhan)
Similar to the `rescue` modifier, an `ensure` modifier allows writing `ensure` block in one line: `do_something ensure clean_up`.UlyssesZhan (Ulysses Zhan)
alanwu (Alan Wu) wrote in #note-2: > Seems to be already addressed by #22097. I see. My quick issue search did not dig it up. I would say `using R; something` is much easier than `-> { something }.refined(R).()`, and we can have both...UlyssesZhan (Ulysses Zhan)
Currently there is `Module#using`. The scope where `using` is effective is the lexical scope of the module eval block (blocks for `module` keyword, `Module::new`, `module_eval`, and `module_exec`). However, since any block is a lexical s...UlyssesZhan (Ulysses Zhan)
Basically `preextend` is equivalent to `singleton_class.prepend`. Since we already have `extend` (basically equivalent to `singleton_class.include`), why not have `preextend`? Related: #6452 #8041UlyssesZhan (Ulysses Zhan)
Personally I have stumbled upon use cases of this method for at least three times. I finally found this feature request. I forgot what I wanted to do the previous times, but the last time I wanted this feature is when I wanted to generat...UlyssesZhan (Ulysses Zhan)
In #17881, it was accepted that `Module#const_added` is called when there is a new constant added to the namespace of the module. Since `main` can also serve as a namespace, it should also be able to use this callback. ```ruby def c...UlyssesZhan (Ulysses Zhan)