T, > This was discussed sometime ago. The solution (mostly > arrived at by Peter Vanbroekhoven) is to use a > different comparision method. I can't find this discussion in the archive. Can you give me a link or a message number? - Warren Brown
on 2005-11-23 16:06
on 2005-11-23 20:16
> I can't find this discussion in the archive. Can you give me a link > or a message number? Largely from Ruby-talk 115120, although the solution really came about on the old suby-muse mailing list. I'm not sure everyone understood me though. The problem is that String's #<=> and #succ methods are not compatible. Therefore Range#member? and Rage#include? which use #<=> can not provide proper results for String-based Ranges. The solution is to have Range use a different comparision method, namely #cmp. In most classes #cmp will of course just be an alias for #<=>, but it String is would differ to be compatible with #succ, and then #include and #member would be correct. Q.E.D. T.
on 2005-11-23 21:08
s/it String is/in String it/