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

Rephrase definition of single-expression function #3639

Merged
merged 3 commits into from
Jul 19, 2023

Conversation

vegarsti
Copy link
Contributor

@vegarsti vegarsti commented Jun 26, 2023

The current definition says "When a function returns a single expression", which I don't think is correct: As long as the return type is not Void, a function always returns a single expression. And it sounds as if the function returns all the expressions inside it.

This is an opinionated nitpick, though, so feel free to close this!

The current definition says "When a function returns a single expression", which I don't think is correct: It sounds as if the function returns the expresions inside it.

This is an opinionated nitpick, though, so feel free to close this!
@sarahhaggarty sarahhaggarty self-assigned this Jun 29, 2023
Copy link
Collaborator

@sarahhaggarty sarahhaggarty left a comment

Choose a reason for hiding this comment

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

I agree that using "returns" is confusing. What do you think about this version that I suggest instead?

docs/topics/functions.md Outdated Show resolved Hide resolved
@vegarsti
Copy link
Contributor Author

Yes, that is great! Much better than mine, and clearer than main

@sarahhaggarty sarahhaggarty merged commit abb1db9 into JetBrains:master Jul 19, 2023
4 checks passed
@sarahhaggarty
Copy link
Collaborator

Thanks for sharing your thoughts with us @vegarsti !

@vegarsti vegarsti deleted the patch-1 branch July 19, 2023 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants