From: Logan Capaldo Date: 2006-01-15T06:54:16+09:00 Subject: Re: Range#member? Oddity --Apple-Mail-1-54650762 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Jan 14, 2006, at 4:41 PM, ara.t.howard@noaa.gov wrote: > in any case, ruby makes no guarantee that > > (a..b).each{|x| p x} > > will complete, so even if we had real numbers that would still be a > valid > construct - though mixing in Enumerable into Range would be strange > then - but > it not the case. Here's a thought, get rid of #each and Enumerable from Range, but add in a #to_enum method (no args) that would return an Enumerator for the range. This way programmers could say, "I solemnly swear that I know iterating thru a range of strings doesn't make sense with include, but I want to do it anyway." ("ab".."xyz").to_enum.to_a # etc... On second thought, that looks unnecessary. How about: % cat a.rb ("abc".."wxyz").to_a % ruby -w a.rb warning: You fool! By doing this you know include? will make no sense! Maybe not. Stupid ranges. Hmph. --Apple-Mail-1-54650762--