From: Dave Thomas Date: 2008-03-27T02:25:54+09:00 Subject: Re: Recent changes in Range#step behavior On Mar 26, 2008, at 11:58 AM, Yukihiro Matsumoto wrote: > |I honestly feel that the > |name implies set membership, so > | > |(1..3).member?(2.5) > | > |should, I believe, be false, as 1..3 is the set of integers from 1 > to 3. > > I thought membership for numeric values should work on continuous set. > But as you pointed out, integers are discrete. Hmm. If member? is allowed to use non-discrete comparisons for integers, then it should probably also do them for ranges of strings. Right now ('a'..'z').member?('aa') returns false, because 'aa' is not in the set 'a', 'b'...'z'. But, logically, if (1..3).member?(1.5) is true, then the string range should return true as well, as 'a' <= 'aa' <= 'z'. Dave