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

Document pattern syntax and semantics #2853

Merged
merged 5 commits into from
Jun 2, 2023

Conversation

geoffromer
Copy link
Contributor

Integrates the content of #2188 into pattern_matching.md

Closes #2852

Pretty much a raw cut-and-paste, to make subsequent edits easier to see. There are some structural changes a the beginning and end, though.
Also add references and alternatives-considered.
@geoffromer
Copy link
Contributor Author

FYI: commit f0f454a is almost a raw cut-and-paste from p2188.md, with some edits at the beginning and end, so you can use that as a diff base to see the edits I made to that content.

Copy link
Contributor

@zygoloid zygoloid left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for separating the proposal text from the edits; that made the review much easier :)

Some relatively minor comments, but I think this is fine to land as-is and iterate from there if needed.

Comment on lines 160 to 162
As specified in
[#2022](/proposals/p2022.md#the-behavior-of-unused-name-bindings), the `unused`
keyword indicates that the binding is intended to not be used.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should include some text like this from #2022 describing what unused does:

Names that are qualified with the unused keyword are visible for name lookup
but uses are invalid, including when they cause ambiguous name lookup errors. If
attempted to be used, a compiler error will be shown to the user, instructing
them to either remove the unused qualifier or remove the use.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this comment is still unresolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, missed that. Done.

docs/design/pattern_matching.md Outdated Show resolved Hide resolved
docs/design/pattern_matching.md Show resolved Hide resolved
docs/design/pattern_matching.md Show resolved Hide resolved
docs/design/pattern_matching.md Show resolved Hide resolved
docs/design/pattern_matching.md Show resolved Hide resolved
@zygoloid zygoloid merged commit b59b3fb into carbon-language:trunk Jun 2, 2023
@geoffromer geoffromer deleted the pattern-docs branch June 2, 2023 17:29
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.

Document pattern syntax and semantics
2 participants