From: dblack@... Date: 2007-02-20T04:24:04+09:00 Subject: Re: For loops don't count down Hi -- On Tue, 20 Feb 2007, Robert Dober wrote: > On 2/19/07, Yukihiro Matsumoto wrote: >> Hi, >> >> In message "Re: For loops don't count down" >> on Tue, 20 Feb 2007 02:45:27 +0900, Daniel Schierbeck >> writes: >> >> |Is there a necessity for a range such as 5..0 to be empty? >> >> 5..1 is the easiest case, > No it is not, how could we distinguish between a "reversed" range and > an "empty" range. > but what if "abz".."abc" where we couldn't >> define reasonable String#pred. Just raise error? > With all due respect if we have a reasonable String#succ we can define > a reasonable String#pred. See the thread starting at ruby-talk 38910 for an earlier discussion of this. It's not easy, and it's arbitrary and of questionable usefulness. (I don't think ranges need to be any more array-like than they already are -- possibly less.) David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)