2 ms·
The semicolon as a statement separator is such a lovely thing... That particular convention goes back to ALGOL-58. In ALGOL-58, semicolon is a statement separ
by Animats 12y ago
The semicolon as a statement separator is such a lovely thing...
That particular convention goes back to ALGOL-58. In ALGOL-58, semicolon is a statement separator. See page 14 of the ALGOL-58 report:
http://www.softwarepreservation.org/projects/ALGOL/report/Algol58_preliminary_report_CACM.pdf http://www.softwarepreservation.org/projects/ALGOL/report/Al...
C goes the other way, with semicolon as a statement terminator. 56 years after ALGOL-58, we still don't have convergence on this. Wikipedia has a table:
https://en.wikipedia.org/wiki/Comparison_of_programming_languages_%28syntax%29#Statements https://en.wikipedia.org/wiki/Comparison_of_programming_lang...
- bjz_ 12y agoOh interesting, I didn't know that ALGOL had that. Looking through the Wikipedia pages, it seems that Rust most likely gained it via the ALGOL->ISWIM->ML->Ocaml->Rust route. I hope it catches on in more imperative languages in the future. After using it for a while, statement terminated syntax feels so clunky in comparison. I love being able to break out into a block like: let foo = { /* do stuff */; some_expression };