On Sep 20, 2007, at 9:14 PM, Sebastian Hungerecker wrote:

> Xavier Noria wrote:
>> So, in what sense succ is not required?
>
> You can have a range of objects that don't have succ. You just  
> can't iterate
> over that range.

You are saying that Ruby is implemented in a way that allows you to  
define an object, use it to build a Range, and use the range in a way  
that does not break the program. Agreed.

But the documentation says "must respond to" and "as long as". That's  
why I said Range assumes #<=> and #succ, because the documentation  
says so.

If you use pass objects to .. that do not respond to #succ, you are  
indeed feeding _invalid_ objects to .. according to the  
documentation. The program may run, but that doesn't matter.

-- fxn