From: Logan Capaldo Date: 2006-01-14T10:36:08+09:00 Subject: Re: Range#member? Oddity --Apple-Mail-1--18436058 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Jan 13, 2006, at 7:53 PM, gwtmp01@mac.com wrote: > I understand the desire to generate a sequence of strings > as defined by the current behavior of String#succ but I don't > understand > why you would want to use a Range object as a shortcut to that > sequence. > That particular sequence really has nothing to do with an interval > or the ordering defined by String#<=> As far as I can tell two classes(Well 4ish) have #succ methods. Integers and Strings. For all integers x, x has the property that x.succ > x is true. There exists at least one String x for which x.succ > x is true, and at least one String x for which x.succ > x is false. So the question is, what is a Range? Is it a pair of end-points for checking between- ness? Is it the set of all values between those end points? If it is the second, I would argue that #to_a is meaningless for strings because there are end points for which the set would have infinite cardinality (i.e. ("a".."b"), the set of strings matched by /^a+\z/ at least is in that "range".). --Apple-Mail-1--18436058--