-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Semicolon #1924
Comments
I'm going to let the leads respond here. For convenience I'll copy @josh11b's #1739 (comment):
|
It's important to distinguish between two possible features here:
I tend to think the first approach isn't right for Carbon, but it's basically sound. On the other hand, the JavaScript approach is widely regarded as a mistake (even the original designer agrees), so Carbon definitely should not follow that example. |
The leads chatted and agree with the rationale write up by @josh11b that was quoted here. Marking this as decided "not planned". |
@chandlerc Should the decision to include semicolons be codified by a proposal? |
If it isn't already covered by a proposal around statements, yes, it should. (I thought it might have already been covered, but haven't checked thoroughly...) |
I may be wrong here, but I don't think we've had one -- https://github.com/carbon-language/carbon-lang/blob/trunk/docs/design/blocks_and_statements.md has no references. |
Filed #2002 to track the proposal need. |
Statements, declarations, and definitions will terminate with either a semicolon (`;`) or a close curly brace (`}`). Semicolons are never optional. For example, with a semicolon, `x = x + 2;`. With a close curly brace, `for ( ... ) { ... }`, or `class C { ...}`. This does not affect any approved proposal; rather, it makes an important assumption explicit. Based on lead decision #1924 Fixes #2002
Is the semicolon actually required? It is no longer required in javascript so it seems like you could get rid of it here.
The text was updated successfully, but these errors were encountered: