From: Ryan Davis Date: 2008-07-10T08:00:55+09:00 Subject: [ruby-core:17708] [Ruby 1.8 - Bug #252] (Open) Array#sort doesn't respect overridden <=> Issue #252 has been reported by Ryan Davis. ---------------------------------------- Bug #252: Array#sort doesn't respect overridden <=> http://redmine.ruby-lang.org/issues/show/252 Author: Ryan Davis Status: Open Priority: Normal Assigned to: Yukihiro Matsumoto Category: Target version: We had this issue reported against rubinius. We're not sure whether it is a bug or a feature in MRI. class String def <=>(other) self.length <=> other.length end end junk = %w[these words should be sorted in the order of their length] puts junk.sort MRI (1.8, 1.9) does not respect new behavior of <=>. Bug or feature? ---------------------------------------- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account