On Wednesday, June 17, 2015 at 8:04:11 AM UTC-5, Jerry Xiong wrote: > > Today I spend many time to find a bug in my code. It is turn out that I > mistakenly wrote sum(X,2) as sum(X.2). No any error information is reported > and Julia regarded X.2 as X*0.2. The comma "," is quite close to dot "." in > the keyboard and looks quite similar in some fonts. As there is no any > error occur, this bug will be dangerous. Also, it is not intuitive to > understand X.2 is X*0.2. I think maybe it is better to forbid syntax like > X.2 but only allowed .2X. >
This appears to be fixed in 0.4: julia> x = 100 100 julia> x.2 ERROR: syntax: extra token "0.2" after end of expression julia> sum(x.2) ERROR: syntax: missing comma or ) in argument list julia> f(x) = x.2 ERROR: syntax: extra token "0.2" after end of expression julia> f(x) = sum(x.2) ERROR: syntax: missing comma or ) in argument list
