4 ms·
Personally I'm more against "=" being the assignment operator, which should be ":=". But I have no problems with the actual syntax so long as it's clearly defin
by Jach 16y ago
Personally I'm more against "=" being the assignment operator, which should be ":=". But I have no problems with the actual syntax so long as it's clearly defined what (x = y) returns. (Does it return y? x? true if assignment was successful? Does it call a operator=() function that blows up the moon?) In languages where the line between statement and expression is nil it would be especially odd to flag this as illegal.
Flash Builder's Actionscript compiler has saved me from that a couple times in memory, though, so I agree it should be a warning if you don't wrap it in extra parens. gcc also will complain.
- chromatic 16y agoPersonally I'm more against "=" being the assignment operator, which should be ":=". The problem with := is that you run the risk of the Pascal trap, in that no language which uses := for assignment has ever become more popular than Pascal.
- redthrowaway 16y agoIn general, I just don't like hitting shift, and so am opposed to :=.
- Jach 16y agoLet's compromise and make it ;=.
- deleted 16y ago[deleted]
- redthrowaway 16y agoI'd rather if the compiler simply determined whether or not it was used as an assignment or comparison and just go with a single =.