On Wed, Oct 31, 2012 at 5:00 PM, Carlo E. Prelz <fluido / fluido.as> 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