From: Robert Klemme Date: 2011-02-01T17:31:30+09:00 Subject: Re: Decreasing range? On Tue, Feb 1, 2011 at 8:01 AM, Josh Cheek wrote: > On Tue, Feb 1, 2011 at 12:51 AM, Stefano Grioni wrote: > >> Can anyone explain me why this strange behavior is implemented as such, >> and how can I circle that without the need to use the very ugly >> 1..4).each { |i| p (4-i) } ? >> > 4.downto(1) { |i| p i } This is certainly the most efficient variant. For the general case there is Enumerable#reverse_each - at least from 1.8.7 on. Since it's implemented in Range as well I guess this will be efficient, too. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/