From: Stefan Walk Date: 2006-01-14T23:47:26+09:00 Subject: Re: Range#member? Oddity dblack@wobblini.net wrote: > But other weirdnesses arise :-) > > irb(main):019:0> ("A".."z").member?("g") > => true > irb(main):020:0> ("A".."z").to_a.include?("g") > => false > > > David > IMO, the thing at fault here is that Ranges include Enumerable. From a mathematical POV, that's nonsense, and that's why oddities like this exist. Things that can be used for ranges can not used like an Enumarable (rational..rational, float..float), because those don't have #succ instance methods... and String ranges behave oddly because the member? checks use the <=> behaviour, and each uses succ... Regards, Stefan