From: Tom Cloyd Date: 2009-05-13T08:57:48+09:00 Subject: Re: Whaaaaat? Ben Bleything wrote: > On Tue, May 12, 2009 at 4:39 PM, Tom Cloyd wrote: > >> p [0..5].include? 0 >> false >> p [0..5].member? 0 >> false >> >> This is nuts. The world is flat, evidently. >> > > Nope. > > >> Can someone explain this nonsense? >> > > Yep. You've got an array with a single member... the range 0..5. > > I think what you meant is: > > (0..5).include? 0 > => true > > :) > > Ben > > > Well, nuts. This clarifies it a bit: irb(main):009:0> (1..10).class => Range irb(main):010:0> [1..10].class => Array irb(main):011:0> Why can't ruby just do what I mean, rather than what I say? Is that asking too much? (heh heh) Thanks for the clarifications. This list has not equal for speedy answers (usually). t. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist Bellingham, Washington, U.S.A: (360) 920-1226 << tc@tomcloyd.com >> (email) << TomCloyd.com >> (website) << sleightmind.wordpress.com >> (mental health weblog) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~