From: David Alan Black Date: 2001-01-07T02:36:20+09:00 Subject: [ruby-talk:8750] Re: (start..end) where start > end On Sun, 7 Jan 2001, Robert Gustavsson wrote: > >> (7..0).each do > > >Try this: > > 7.downto(0) do |n| puts n end > > (0..7).to_a.reverse.each do |n| puts n end > > Do you agree with me when I say that (7..0) is more beautiful? And it would > probably be more efficient too. It's certainly more beautiful than the to_a.reverse version. I don't mind #downto too much -- though (7..0) would be nice. I wonder if there's something inherent in the definition of a range (as opposed to an array) which precludes that. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav