From: Dave Thomas Date: 2008-03-27T06:38:37+09:00 Subject: Re: Recent changes in Range#step behavior On Mar 26, 2008, at 3:48 PM, David Flanagan wrote: > 2) I don't believe it is correct to regard Ranges as sets of values. > They are something different and can have continuous or discrete > behavior depending on how they are used. If you define a range as a > kind of set, then the behavior of include? and member? seems wrong. > But if you instead look at how those methods behave in 1.8 and 1.9 > then it becomes clear that a range is not a set. David: By definition, ranges are defined for all objects other than a few built-in ones to use succ() and comparisons. Thus they are by definition a representation of a set of values. The elements in 1..3 are the integers 1, 2, and 3. The float 1.5 is not a member of this list, so member? should return false in this case. I strongly advocate fixing the current behavior so that the method name and the method behavior are more aligned. That way cover? can do its thing and member? can do its. Cheers Dave