4 ms·
You are mistaken about rust. I can't think of a construct that is not an expression.
by jeremyjh 10y ago
You are mistaken about rust. I can't think of a construct that is not an expression.
- steveklabnik 10y agolet x = 5; (That said, very nearly everything is an expression, yes)
- wisam 10y agoI don't know about Rust; but in ML family, everything in top level is a binding. Whether it's a variable, function, type or structure. SML is explicit about it and its syntax makes it clear what type of binding is going on. val x = 5 fun f = fn x => x * x datatype weekend = Sat | Sun So while on top level not everything is an expression, everything on the RHS is an expression.
- qwertyuiop924 10y agoIn rust, assignment isn't an expression, but everything else is.