From: shuujii@... Date: 2019-06-14T01:02:36+00:00 Subject: [ruby-core:93119] [Ruby trunk Bug#15857] <=> の右辺が <=> を実装していない場合の振る舞い Issue #15857 has been updated by shuujii (Shuji KOBAYASHI). > > @jeremyevans0 Thank you for your comment. About Complex, I agree with most of v2 patch, but I have some comments. > > > > - Should methods from Comparable that are currently disabled be enabled? > > I don't think so, but I don't have a strong opinion. If you would like those added, please submit a separate feature request for that. I don't have a strong opinion, too. > > About other than Complex, <=> of some classes, such as String and Time, will fail if ~~LHS~~RHS does not implement <=>. It's better to return nil in this case too, because whether it's comparable or not and whether ~~LHS~~RHS implements <=> or not is essentially irrelevant, I think. > > I agree, but please submit a separate bug report for that as it is unrelated to Complex#<=>. Sure. I will create another ticket. ---------------------------------------- Bug #15857: <=> ������������ <=> ��������������������������������������������� https://bugs.ruby-lang.org/issues/15857#change-78548 * Author: shuujii (Shuji KOBAYASHI) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- `<=>` ������������ `<=>` ���������������������������������`nil` ��������������������������������������������������������������������������������������������������������������������������������������������� ```ruby 0 <=> 0i #=> NoMethodError (undefined method `<=>' for (0+0i):Complex) 0 <=> BasicObject.new #=> nil :a <=> 0i #=> nil "a" <=> 0i #=> NoMethodError (undefined method `<=>' for (0+0i):Complex) ``` ���������`0 <=> 0i` ������������������`0 == 0i` ��� `true` ��������������������������������������������������������������������������������������������������� ---Files-------------------------------- complex-real-spaceship.patch (8.75 KB) complex-real-spaceship-v2.patch (8.08 KB) complex-real-spaceship-v3.patch (7.79 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: