Issue #8422 has been updated by drbrain (Eric Hodel).


=begin
How do you sort an infinite Enumerable?

  ruby -rprime -e 'p Prime.each.reverse_sort.take 10'
=end
----------------------------------------
Feature #8422: add Enumerable#reverse_sort and Enumerable#reverse_sort_by
https://bugs.ruby-lang.org/issues/8422#change-39762

Author: Hanmac (Hans Mackowiak)
Status: Feedback
Priority: Normal
Assignee: 
Category: 
Target version: 


they are better when you want descending order,
  enum.sort.reverse
does work too, but it is to slow because it needs to build that result array twice

they both can be defined just like #sort and #sort_by but negates the result of the compare block


-- 
http://bugs.ruby-lang.org/