Skip to content

Add documentation on pattern bindings #2035

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

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 8, 2023

Another area that’s not super obvious. Add some documentation that hopefully sheds some light into why pattern bindings exist and what they do.

And also improve documentation of AttributeSyntax.arguments.

Another area that’s not super obvious. Add some documentation that hopefully sheds some light into why pattern bindings exist and what thye do.
@ahoppen ahoppen requested a review from bnbarham August 8, 2023 23:02
@ahoppen
Copy link
Member Author

ahoppen commented Aug 8, 2023

@swift-ci Please test

documentation: """
Declaration of one or more variables

The core of a variable declaration consists of a binding specifier (`let` or `var),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The core of a variable declaration consists of a binding specifier (`let` or `var),
The core of a variable declaration consists of a binding specifier (`let` or `var`),

initializers and accessors.

A variable declaration can contain multiple pattern bindings, because it’s possible
to define multiple variables after a single `let` keyword as follows.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd drop the as follows. Or use eg/, for example.

@ahoppen ahoppen force-pushed the ahoppen/binding-documentation branch from 4a52604 to 9aa3d0a Compare August 9, 2023 03:48
@ahoppen
Copy link
Member Author

ahoppen commented Aug 9, 2023

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge August 9, 2023 03:48
@ahoppen
Copy link
Member Author

ahoppen commented Aug 9, 2023

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 55f0b1d into swiftlang:main Aug 9, 2023
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