4 ms·
Allow me to hijack a little. I'm working on a new language. Would you people object to ':' for assign and single '=' for equality ? int i:42 if i=42 print
by alcover 4y ago
Allow me to hijack a little. I'm working on a new language.
Would you people object to ':' for assign and single '=' for equality ?
int i:42
if i=42 print "ok"
- bhawks 4y agoGolang uses : to assign in struct initialization and := for new variable assignments so there is some prior art. Practically speaking I find : to be challenging to quickly scan out of source visually. In golang this objection is muted slightly because struct initialization usually ends up being clearly indented by the formatter.
- mkl 4y agoMaxima does something like this. It's weird to use. I think := for assignment makes more sense if you want = for equality (i.e. like Pascal etc.).