You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think we have it anywhere in our speaker notes, but we should make an explicit mention of it. Usually when teaching I try to bring this up around when semicolons are discussed or when we talk about tuple and array types.
This is a nice feature of the language that's easy to miss if not called out: to minimize git diffs, almost every syntactic construct in Rust allows separators to also be used as terminators. This includes commas in tuple and array values, semicolons separating expressions (though the trailing semicolon does have semantic meaning in this case), and even pipes as leading delimiters in patterns (as in Standard ML or OCaml):
I don't think we have it anywhere in our speaker notes, but we should make an explicit mention of it. Usually when teaching I try to bring this up around when semicolons are discussed or when we talk about tuple and array types.
This is a nice feature of the language that's easy to miss if not called out: to minimize git diffs, almost every syntactic construct in Rust allows separators to also be used as terminators. This includes commas in tuple and array values, semicolons separating expressions (though the trailing semicolon does have semantic meaning in this case), and even pipes as leading delimiters in patterns (as in Standard ML or OCaml):
The text was updated successfully, but these errors were encountered: