"for i in 1 ..2:" give syntax error while "for i in 1..2 or 1 .. 2:" works.
also x = x -10 gives syntax error. x = x-10 and x = x - 10 works fine.
Normally, I am consistent with spaces or no spaces so this isn't a problem for me but the error message resulting from accidentally leaving out the space in x = x -1 in a large case statement merely said "not all cases are covered". the error message pointed to the case statement line number and it took a while to track down the problem.
Is this the way spacing is suppose to work?
I think so. This may have changed recently (since 0.18.0).
Here is the changelog. One of the breaking changes listed says that "The unary < is now deprecated, for .. < use ..< for other usages use the pred proc". So, I am thinking that this is an intentional change. Maybe someone can confirm?
My real problem was the bad error message pointing to the wrong statement.
I'm not sure what you mean by "pointing to the wrong statement". They point to the line where the error occurs, and correctly tell you what the failure is. In the first case, the compiler tells you that the for heading is complete, and that you should add a colon before the statements/expressions of the for body (..2 in this case). In the second case, it tells you that the assignment statement is complete, and that the next statement or expression (-10) is not correctly indented (which is vacuous but technically true, because it's not indented at all). In the first case, I think the error is actually reasonable; consider an analogous mistake: for x in s inc y. Here it's clear why it's bugging you about the colon, but it's really no different from your actual example. In the second case, I agree the compiler could've been more helpful and said something like "expected newline before -10", which doesn't exactly explain the problem, but it's general enough, and gives a good hint.