On Sat, 14 Jan 2006 01:26:22 +0100, Logan Capaldo <logancapaldo / gmail.com>  
wrote:

>
> On Jan 13, 2006, at 7:18 PM, gwtmp01 / mac.com wrote:
>
>>
>> On Jan 13, 2006, at 6:54 PM, David Vallner wrote:
>>> Well, to work well in Ranges, for any String s, s.succ > s must hold  
>>> true.
>>
>> How about having Range use Object#strict_succ to generate
>> its sequence?  Define String#strict_succ as needed to guarantee
>> s.succ > s and then alias strict_succ to succ for other classes
>> (such as Fixnum) so they don't break when used in a Range.
>>
>>
>> Gary Wright
>>
>>
>>
>>
>
> This seems to me to make the problem worse. People expect the values  
> generated by String#succ to be in the array when doing a to_a for  
> instance. I believe the real solution would be to bring back the  
> distinction between member and include (possibly with a new name for the  
> method with the functionality of #member).
>


I agree that the change proposed would break Range#to_a for strings, which  
I can imagine being used. The real solution would be people coding sanely  
and using Integers to represent integers, and Strings to represent text -  
using unsuitable data types resulting in a bug is arguably not a language  
fault.

David Vallner