From: Josh Cheek Date: 2009-08-17T22:21:20+09:00 Subject: Re: Bizarre Range behavior --000e0cd6af3cf3052a04715646b1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Sun, Aug 16, 2009 at 5:20 PM, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Bizarre Range behavior" > on Thu, 6 Aug 2009 01:30:57 +0900, Rick DeNatale < > rick.denatale@gmail.com> writes: > > |Well my vote is to cook it to use the methods of the endpoints rather > |than doing something special IF the endpoints are strings and both > |happen to be numerical. That seems as half cooked to me as the > |current situation. > > Well, since it's a magic, we need to draw some line according to > the trade-offs. > > |And if you follow the "if they're numerical" path what do you do about > |things like > | > |("0x32".."0xFE").to_a > |("032".."0100").to_a > |("032".."0x32").to_a > > Since #succ does not treat 0x32 etc. specially, I don't think we need > to consider them as numerical. > > I am not going to add magic anywhere but it has already existed. > > matz. > > I prefer predictable behaviour, if I test it with "1".."10" then I will be very surprised when it breaks on "2".."10" So surprised that I probably won't even look there for many hours. (well, now that I've read this thread I would, but this bug is so esoteric that I would probably need to pull out the debugger, otherwise). There is surely noone who uses this now since it's behaviour is inconsistent. So what do we gain from changing it? Perhaps someone can use it. What do we gain from leaving it? An obscure nuance known to a few. One of the nice things about this language is that there are not many of these quirks. I think the pride of knowing something that can't be easily discovered or tested for is the reason others object to the change. But in my mind, that contradicts the principles that make Ruby so beautiful. --000e0cd6af3cf3052a04715646b1--