Writing this expressions does not work:
With a parse error of:
unexpected '-'
expecting end of "="
This is the same for a leading +. This holds for let exprs, function equations, and any other cases where an = can be followed by a symbol instead of an alpha-numeric character.
This isn't the worst of errors, as the line number associated is correct, but the message is vague. In addition it may be counter intuitive, as let x=5 is valid, but let x=-5 is not. This was brought up in today's (Nov. 20th) Friday meeting, and a couple of options were mentioned.
- These should be valid expressions (Jennifer)
- It should be enforced as a parse error, where
= must always be followed by a space and with a better message (Martin)
Some caveats that I would like to add:
- Syntax highlighting currently changes when
=- is combined. This may be a confusing factor if we make this a valid expression.
- Enforcing the space is likely to break existing programs that do not include a space after
=.
Either way, it appears this is something we will consider post-Fall term.
Writing this expressions does not work:
With a parse error of:
This is the same for a leading
+. This holds forletexprs,functionequations, and any other cases where an=can be followed by a symbol instead of an alpha-numeric character.This isn't the worst of errors, as the line number associated is correct, but the message is vague. In addition it may be counter intuitive, as
let x=5is valid, butlet x=-5is not. This was brought up in today's (Nov. 20th) Friday meeting, and a couple of options were mentioned.=must always be followed by a space and with a better message (Martin)Some caveats that I would like to add:
=-is combined. This may be a confusing factor if we make this a valid expression.=.Either way, it appears this is something we will consider post-Fall term.