|
|
|
|
|
by ww520
4989 days ago
|
|
You meant semicolon is used as a binary operator, joining the statements into one long expression. Since it's an operator, its behavior can be defined to however make sense. Why not just say in the absence of the right operand, return the result of the left operand? Just like || (or) can return the result of left or right operand. So type of 'a' is A. Type of 'a;b' is B. Type of 'a;' is A. |
|
Not necessarily no, I don't know how it works precisely in Rust but in Erlang it is not an operator, it's exactly what I wrote: a separator.