3 ms·
The significance of whether a semi-colon ends a line or not bugs me.
by msie 11y ago
The significance of whether a semi-colon ends a line or not bugs me.
- neverminder 11y agoI suppose it depends on one's background. It doesn't bug me that much, but coming from scala background I just take functional/monadic approach and it feels right.
- pcwalton 11y agoI proposed making it insignificant several years ago and most of the Rust community wanted it to stay the way it was, so it was abandoned. I don't actually really care much either way.
- bjz_ 11y agoYeah, you just have to flip your thinking to see it as an expression separator as opposed to a statement terminator.
- ben0x539 11y agoDon't think of it as optional semi-colons, think of the { } block syntax as containing zero or more alway-semi-colon-terminated statements, as well as zero or one bare not-a-statement never-a-semicolon expression giving a value to the whole block. <:D
- bryal 11y agoMore than a line terminator, it's an expression separator, similar to the comma operator in C.[1] [1] http://en.wikipedia.org/wiki/Comma_operator http://en.wikipedia.org/wiki/Comma_operator