Re:Tim Bray doesn't know operator precedence rules
by jsn on Wednesday June 30, 2010 @07:51AM
(#1474536)
it's neither 6 nor 9 there, actually :) it's 7.
Re:Tim Bray doesn't know operator precedence rules
by almost on Wednesday June 30, 2010 @07:56AM
(#1474547)
You clearly don't understand the advanced kind of maths I'm doing there ;)
Re:Tim Bray doesn't know operator precedence rules
by ramchip on Wednesday June 30, 2010 @08:28AM
(#1474610)
Haskell to the rescue!
ghci> let f = let 2*3=5 in 1+2*3
ghci> f
6
Re:Tim Bray doesn't know operator precedence rules
by vijaydev on Wednesday June 30, 2010 @11:10AM
(#1475050)
brilliant!
Re:Tim Bray doesn't know operator precedence rules
by jonsen on Wednesday June 30, 2010 @07:52AM
(#1474537)
"1 + 2 * 3" is quite obviously 6
Obviously ;)
Also, "1 + 2 * 3" is quite obviously 6 and not 9 in languages with operator precedence, I really don't think you need to write "1 + (2 * 3)".
Everything in moderation.
EDIT: hahaha, well I feel stupid. I'm leaving the incorrect answer there because it's too funny not to :)