On Wed, Oct 31, 2012 at 5:00 PM, Carlo E. Prelz <[email protected]> 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 ([email protected]):
>
> > 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

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to