From: Robert Klemme Date: 2012-11-01T03:57:47+09:00 Subject: Re: bug?: local variable created in if modifier not available in modified expression --047d7b2e089f6c599604cd5f7aa0 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Oct 31, 2012 at 5:00 PM, Carlo E. Prelz wrote: > Subject: Re: bug?: local variable created in if modifier not > available in modified expression > Date: Thu 01 Nov 12 12:48:58AM +0900 > > Quoting Robert Klemme (shortcutter@googlemail.com): > > > With an "if" it's never necessary. And I do not think it makes a > > difference performance wise. > > Having spent my good share of debugging time, I want to add that it > happens to me more often than I would like to forget one of the two = > in equality tests. I am infinitely grateful to any mechanism that > warns me of single equals in ifs; mistaken single ='s in ifs are hard > bugs to catch. > > You mean like $ ruby -ce 'if a = 9 then puts 1 end' -e:1: warning: found = in conditional, should be == Syntax OK ? Kind regards robert --047d7b2e089f6c599604cd5f7aa0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Wed, Oct 31, 2= 012 at 5:00 PM, Carlo E. Prelz <fluido@fluido.as> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex"> =A0 =A0 =A0 =A0 Subject: Re: bug?: local variable created in if modifier no= t available in modified expression
=A0 =A0 =A0 =A0 Date: Thu 01 Nov 12 12:48:58AM +0900

Quoting Robert Klemme (shortc= utter@googlemail.com):

> With an "if" it's never necessary. =A0And I do not think= it makes a
> difference performance wise.

Having spent my good share of debugging time, I want to add that it happens to me more often than I would like to forget one of the two =3D
in equality tests. I am infinitely grateful to any mechanism that
warns me of single equals in ifs; mistaken single =3D's in ifs are hard=
bugs to catch.


You mean like

$ ruby -ce 'if a =3D 9 then= puts 1 end'
-e:1: warning: found =3D in conditional, should be =3D= =3D
Syntax OK

?

Kind regards

robert
--047d7b2e089f6c599604cd5f7aa0--