Skip to main content
3 events
when toggle format what by license comment
Aug 22, 2014 at 8:56 comment added mouviciel @delnan - You are correct. In my mind an assignement is a statement, not an expression, i.e., let a take the current value of b, without the second part: and return that value.
Aug 22, 2014 at 8:24 comment added user7043 A distinction between expressions and statements doesn't necessarily help with if (a = b), as long as assignment is an expression (it's one in Java and C# which address this problem through other means). Making assignment a statement would help, but equally well one can restrict if to boolean values (Java, C#) and in a expression-oriented language, additionally make it the moral equivalent of a "statement": An expression that returns the unit type (), which is what Rust does.
Aug 22, 2014 at 7:39 history answered mouviciel CC BY-SA 3.0