2 ms·
Swift and Go don't have either. Neither does Kotlin. The difference is that Rust is an expression language (much like ML), and the semicolon determines whether
by jolux 6y ago
Swift and Go don't have either. Neither does Kotlin. The difference is that Rust is an expression language (much like ML), and the semicolon determines whether the resulting expression is returned or thrown away. OCaml needs semicolons when you're doing imperative programming too.
- johncolanduoni 6y agoSwift, Go, and Kotlin all take newlines into account. I guess one could have a definition of “significant whitespace” that excludes that but in any case I strongly suspect that’s what they were referring to.
- jolux 6y agoyes, but I believe they support semicolons as a statement separator on the same line