If “data” is the naming direction folks like, I think the class name should be DataClass. This aligns with kotlin (where data is a keyword before the class keyword) and reads better, IMO: DataClass.new gives you a new class whose purpose...myronmarston (Myron Marston)
I'm quite fond of this proposal--I basically never use Struct unless I specifically need mutability and have been using the values gem for years, which has a simple implementation of about 100 lines: https://github.com/tcrayford/Value...myronmarston (Myron Marston)
Upon upgrading a library to run on Ruby 3.0, I have observed that `Hash#key?` has non-deterministic behavior when the argument uses `DelegateClass`. This non-deterministic behavior was not present in Ruby 2.7. Reproducing this is slig...myronmarston (Myron Marston)
> Don't report a bug on a closed feature, report it as a new bug (and link to the feature), thanks. Thanks, I wasn't aware which way was preferred. I've opened #14267 to report this as a new bug. > ... Agreed, but when dealing wit...myronmarston (Myron Marston)
The following script consistently prints `Proc equality: true` on versions of Ruby before 2.5, but prints `Proc equality: false` on Ruby 2.5: ``` ruby # regression.rb def return_proc(&block) block end def return_procs(&block)...myronmarston (Myron Marston)
For those who are interested, the work around I've implemented in RSpec is [here]( https://github.com/rspec/rspec-core/pull/2497/commits/84670489bb4943a62e783bd65f96e4b55360b141): ``` patch From 84670489bb4943a62e783bd65f96e4b55360b...myronmarston (Myron Marston)
This change introduces a bug in RSpec. I'm working on a work around for RSpec (and hope to cut a release with a fix soon) but users running Ruby 2.5 with an older RSpec version will be affected, and the slight change in semantics introd...myronmarston (Myron Marston)
I think that `Method#instance_method?` and `UnboundMethod#instance_method?` would be very confusing, because my mental model is that _every_ method is an instance method of some class -- it's just that the class might be a singleton clas...myronmarston (Myron Marston)
Thanks for the prompt fix, @nobu!! On a side note, I wasn't notified by email of your fix even though I'm watching this issue so I get notified of updates. Do you know why that is?myronmarston (Myron Marston)
> The "can't iterate" error is simply because Time is float-based: there is no succ number. Floats don't have a `succ` method, and yet `(2.3...3.2) === 3.0` works just fine. Actually, I'm surprised that `succ` is used for `===` at al...myronmarston (Myron Marston)