3 ms·
It bugs me too. Mainly because I don't see anything wrong with "=", plus it's shorter and more intuitive.
by CooCooCaCha 3y ago
It bugs me too. Mainly because I don't see anything wrong with "=", plus it's shorter and more intuitive.
- brendanfh 3y agoThe example in the blog post could have been written a little bit better, but in Onyx ":=" is actually a combination of two operations: defining a new variable with ':', and assigning the value with '='. If the type can be inferred on the right hand-side of the assignment, you can leave out the type between the ':' and the '=' and it effectively becomes a single operator. An alternative way to write that could have been 'input: str = "111 110 121 120";'. To assign in Onyx, you only have to use '='.
- xigoi 3y agoAs a mathematician, I see everything wrong with using “=” for something other than equality. Especially when writing something like x = x + 1.