Interesting user mistake

Enamex via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 3 10:15:23 PDT 2015


On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei 
Alexandrescu wrote:
> we should disallow during tokenization the sequence "=", "+", 
> whitespace. Surely it's not a formatting anyone would aim for, 
> but instead a misspelling of +=.
>
>
> Andrei

Wasn't the original design for these operators in whichever 
language started them actually the swapped form? In any case, I'd 
personally choose to warn against any operator sequence without 
separating whitespaces if the sequence isn't in fact one operator 
(like "=!" (non-warn: "= !") vs "!=", and "=&", and a lot others, 
given operator overloading).

Looking again, it's mostly the fault of OpAssign operators, isn't 
it?


More information about the Digitalmars-d mailing list