From: "BertramScharpf (Bertram Scharpf)" Date: 2013-11-19T04:35:56+09:00 Subject: [ruby-core:58408] [ruby-trunk - Feature #9123] Make Numeric#nonzero? behavior consistent with Numeric#zero? Issue #9123 has been updated by BertramScharpf (Bertram Scharpf). =begin You did not only change the source code, but you also removed an application example I admire for its beauty: a = %w(z Bb bB bb BB a aA Aa AA A) b = a.sort {|a,b| (a.downcase <=> b.downcase).nonzero? || a <=> b } b #=> ["A", "a", "AA", "Aa", "aA", "BB", "Bb", "bB", "bb", "z"] I wonder how you manage not to notice anything about the impertinence of your proposal. =end ---------------------------------------- Feature #9123: Make Numeric#nonzero? behavior consistent with Numeric#zero? https://bugs.ruby-lang.org/issues/9123#change-43001 Author: sferik (Erik Michaels-Ober) Status: Open Priority: Normal Assignee: Category: Target version: Numeric#zero? returns true or false, while Numeric#nonzero? returns self or nil. I've written a patch that fixes this inconsistency and adds a Numeric#nonzero (non-predicate) method that returns self or nil for chaining comparisons. I'd like for this to be included in Ruby 2.1.0. https://github.com/ruby/ruby/pull/452.patch -- http://bugs.ruby-lang.org/