I am wondering why many languages don't just use '=' for both assignment and equality.
Rust is fairly new but still uses:
'let x = 0' and 'if x == 0'.
Is the clarity necessary.[ In many languages ]
We use '()' for tuples, grouping conditions and function parameters.
We use '[]' for declaring arrays, and for indexing arrays.
We use ':' for struct member defaults and switch/case statements.
If these characters can have multiple meanings--why is it so hard for '=' ?
Why don't we just use 'x = 0' and 'if x = 0' ?
We should be able to write compilers that understand context.
We should have humans that understand the context. Am I crazy?
NOTE: If people are wondering about expressions-based languages--I understand. BUT.
ex.1:
let x = if y == 10 {88}
ex.2: let x;
if y = 10 {
x = 88
}