Hacker News new | past | comments | ask | show | jobs | submit login

The significance of whether a semi-colon ends a line or not bugs me.



I 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.


I 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.


Yeah, you just have to flip your thinking to see it as an expression separator as opposed to a statement terminator.


Don'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


More 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: