From: David Vallner Date: 2006-01-14T07:13:52+09:00 Subject: Re: Range#member? Oddity On Fri, 13 Jan 2006 23:00:37 +0100, James Edward Gray II wrote: > On Jan 13, 2006, at 3:58 PM, David Vallner wrote: > >> You could possibly hack around that in Range code to provide for data >> types where generating successors is inconsistent with comparison, but >> I wouldn't like to see that. > > It's not too tough in this case: > > >> ("1".."10").to_a.include?("2") > => true > > James Edward Gray II > Yes, that always works, but it beats the point of having first class ranges as opposed to just having a pythonesque range function in the first place. I'd personally rather coerce the strings to numbers if I know they represent such to get more type safety and possibly some execution speed too. David Vallner