From: David Vallner Date: 2006-01-15T04:17:17+09:00 Subject: Re: Range#member? Oddity On Sat, 14 Jan 2006 19:54:55 +0100, Stefan Walk wrote: > > [snip] > > Range including Enumerable is a fault of the ruby core API, because > (1.0..20) pretends to be enumerable (is_a? returns true, responds_to? > :each returns true), but is not. That is, of course, misleading, but ranges are very commonly used in the special cases when they are indeed enumerable, so I can understand why it's defined that way in the core API. Library design isn't there to replace programmer brains. You could theorethically check whether the range endpoints are comparable, and whether the starting one defines #succ, and then mix in Enumerable to the Ranges that indeed are to get more strictly correct behaviour. David Vallner