On Wed, 2005-07-13 at 08:32 +0900, Levin Alexander wrote:
> Hi,
> 
> I just got an Exception that I found somewhat confusing:
> 
>    $ ruby -e "puts((1..10).include?('a'))"
>    false
> 
>    $ ruby -e "puts(('a'..'z').include?(1))"
>    -e:1:in `include?': undefined method `>' for false:FalseClass  
> (NoMethodError)
>    	from -e:1
> 
>    $ ruby -v
>    ruby 1.8.2 (2004-12-23) [i386-linux]
> 
> Is there a reason for this behaviour?

I think this has something to do with the implementation of
Range#include? (being that it returns rng.start <= val <= rng.end)
An easy way around it is to use ('a'..'z').entries.include?(1) instead
-- 
Luke Worth