From: Joe Percival Date: 2006-03-12T09:25:09+09:00 Subject: Re: unexpected behavior of range.each (Newbie extreme) Timothy Hunter wrote: > Joe Percival wrote: >> Thanks in advance! >> joe >> > > It was done on purpose. Ranges want to be able to iterate from beginning > to end using the .succ method on the objects that the range is > constructed from. That's not possible for (9..5). Also, the definition > for .include? is range.start <= val <= range.end. Not true for (9..5). seems like an odd definition of "include" (and "each") and inconsistent with the behavior for arrays. Also, if (9..5) is not a valid range specification why no error message? It seems to me that the definition of include (and each) for a range could be made a bit more tollerant of direction by making it conditional on the order of the endpoints. Ahh...Well... guess I ought to stop complaining and just go back to learning the language :-) Thanks for the explanation! joe -- Posted via http://www.ruby-forum.com/.