The compiler could allow all of the following syntax
let a=2
let b = a|>Number.toString
let neq = a!=1
let eq = foo==2
let lte = a<=3
let lt = a<3
let gte = a>=1
let gt = a>1
let plus = a+1
let multiply = a*2
let divide = a/2
let mod = a%2==0
let exp = 2**3
let and = a==2&&a==2
let ortest = a==1||a==2
let true = ! false
Special consideration needs to be taken for
- because - is ambiguous with negative values
or because it the characters "or" can be used in variable names
In addition to relaxing the syntax, if there is no whitespace surrounding an operator, then whitespace should be inserted by the formatter. Not sure if that should be a separate issue.
The compiler could allow all of the following syntax
Special consideration needs to be taken for
-
because-
is ambiguous with negative valuesor
because it the characters "or" can be used in variable namesIn addition to relaxing the syntax, if there is no whitespace surrounding an operator, then whitespace should be inserted by the formatter. Not sure if that should be a separate issue.