From: Florian Frank Date: 2004-10-05T22:10:12+09:00 Subject: Re: [RCR] New [] Semantics On 05.10.2004, at 13:20, Brian Candler wrote: > I agree, although it's really only an optimisation, because other > cases will > still give an infinite loop: in particular > > i = 1.0/0 > (2..i).member?(1) > > So you have a halting problem instead :-) True. At least it would behave like the documentation describes it. > > Or fixing it, but I'd also be happy to see it fall back to Enumerable, > as > there's not much efficiency gain in implementing basically the same > thing a > second time within range.c Hmm, i just got another idea, how it would be able to always return true or false for non-Float ranges: def member?(x) include?(x) and Enumerable.instance_method(:member?).bind(self).call(x) end Florian Frank