From: Robert Klemme Date: 2013-05-07T19:58:24+09:00 Subject: Re: The question about 'Range' as Condition --047d7b672e26ada66c04dc1eb1c9 Content-Type: text/plain; charset=ISO-8859-1 On Tue, May 7, 2013 at 12:07 PM, Haibin Shi wrote: > Hi All, > > I don't know why these two codes of behavior will not be the same, > in my opinion, they are the same logic. > No, it's not, because you change the number of range operators. A range operator in an if / unless situation has a built in FlipFlop which will change the state whenever a change in matching occurs: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#UF Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --047d7b672e26ada66c04dc1eb1c9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On Tue, May 7, 2013 at 12:07 PM, Haibin Shi <<= a href=3D"mailto:syunxi@gmail.com" target=3D"_blank">syunxi@gmail.com&g= t; wrote:
Hi All,

I don't know why these two codes of behavior will not be the same,
in my opinion, they are the same logic.

No, it's not, because you change the number of range operators. = =A0A range operator in an if / unless situation has a built in FlipFlop whi= ch will change the state whenever a change in matching occurs:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut= _expressions.html#UF
=A0
Cheers

robert

--
rem= ember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
--047d7b672e26ada66c04dc1eb1c9--