Skip to content
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

return #415

Merged
merged 6 commits into from
May 7, 2021
Merged

return #415

merged 6 commits into from
May 7, 2021

Conversation

mmdriley
Copy link
Contributor

No description provided.

@mmdriley mmdriley requested a review from a team March 24, 2021 07:10
@mmdriley mmdriley added WIP proposal A proposal labels Mar 24, 2021
@google-cla google-cla bot added the cla: yes PR meets CLA requirements according to bot. label Mar 24, 2021
Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I think this is a good starting point.

proposals/p0415.md Outdated Show resolved Hide resolved
proposals/p0415.md Outdated Show resolved Hide resolved
proposals/p0415.md Outdated Show resolved Hide resolved
@jonmeow jonmeow marked this pull request as draft April 20, 2021 16:17
@jonmeow jonmeow removed the WIP label Apr 20, 2021
@mmdriley mmdriley marked this pull request as ready for review May 4, 2021 20:27
@mmdriley mmdriley requested a review from a team as a code owner May 4, 2021 20:27
@github-actions github-actions bot added the proposal rfc Proposal with request-for-comment sent out label May 4, 2021
proposals/p0415.md Outdated Show resolved Hide resolved
@dabrahams
Copy link

Should this proposal say something about the equivalence between a return statement's expression and the expression that follows =>?

@dabrahams
Copy link

Is Void an accepted thing already, or should this proposal use ()?

proposals/p0415.md Outdated Show resolved Hide resolved
@jonmeow
Copy link
Contributor

jonmeow commented May 4, 2021

Is Void an accepted thing already, or should this proposal use ()?

Void is the draft primitive type: https://github.com/carbon-language/carbon-lang/blob/trunk/docs/design/README.md#primitive-types

It is not accepted, but Void seems correct pending a proposal that would settle the issue (likely dependent upon #443)

@zygoloid
Copy link
Contributor

zygoloid commented May 6, 2021

Should this proposal say something about the equivalence between a return statement's expression and the expression that follows =>?

I don't think => syntax for functions is accepted yet. It's in the Basic Syntax proposal, but when we adopted that we said "We aren't necessarily adopting the specific syntax and semantics expressed by this proposal, and those choices will need to be presented and justified from scratch by future proposals." so I'd expect the future proposal that argues for adding a => syntax for functions to be the place where this correspondence is described.

@zygoloid
Copy link
Contributor

zygoloid commented May 6, 2021

This proposal looks good to me, has 5 +1s, and no blocking issues. Please go ahead.

Regen TOC

Update proposal title in list
Permit `Void`-returning functions to `return VoidReturningFn();`

Fix misspelling

Use "or" instead of "/"
TOC

e.g. becomes "for example"
"compile" error

Omit return type instead of `-> Void`
@mmdriley mmdriley merged commit fafd1e8 into carbon-language:trunk May 7, 2021
@mmdriley mmdriley deleted the proposal-return branch May 7, 2021 21:27
@github-actions github-actions bot added proposal accepted Decision made, proposal accepted and removed proposal rfc Proposal with request-for-comment sent out labels May 7, 2021
@jonmeow jonmeow mentioned this pull request Jul 2, 2021
chandlerc pushed a commit that referenced this pull request Jun 28, 2022
Define syntax for `return` in Carbon.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes PR meets CLA requirements according to bot. proposal accepted Decision made, proposal accepted proposal A proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants