From: Robert Klemme Date: 2013-06-12T16:03:13+09:00 Subject: Re: Loop with range question --047d7bdc9ca654d21a04deef9bc3 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On Tue, Jun 11, 2013 at 11:10 PM, Scott H. wrote: > unknown wrote in post #1112056: > > Am 11.06.2013 18:04, schrieb Scott H.: > >> actual =3D> 1 2 3 4 5 6 7 8 9 10 > >> (so I thought by wrapping the range in a =93()=94 it would convert to > >> 3,4,5,6 and then be able to jump over these integers on output) > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > This might help: > > > > 2.0.0-p195 :018 > (3..6).include? 5 > > =3D> true > > 2.0.0-p195 :019 > (3..6).include? 10 > > =3D> false > Note there is also the =3D=3D=3D operator: irb(main):002:0> (3..6) =3D=3D=3D 5 =3D> true irb(main):003:0> (3..6) =3D=3D=3D 10 =3D> false > > Note that a Range and an Integer can never be equal. > > You state a range can never be equal to an integer. Does that mean > i =3D=3D > so is that why (3..6) is not working for me? > It's a general rule that for equivalence the class needs to be identical. I have blogged about this here: http://blog.rubybestpractices.com/posts/rklemme/018-Complete_Class.html Search for "Equivalence" in the page. > Would it make any difference that I'm using 1.9.3-p392? > No. > Did i mention I'm new to ruby and programming :) > :-) Kind regards robert --=20 remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --047d7bdc9ca654d21a04deef9bc3 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable