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

Update generics overview #3061

Merged
merged 4 commits into from
Aug 15, 2023
Merged

Update generics overview #3061

merged 4 commits into from
Aug 15, 2023

Conversation

josh11b
Copy link
Contributor

@josh11b josh11b commented Aug 3, 2023

This reflects changes from a number of approved proposals:

@github-actions github-actions bot requested a review from zygoloid August 3, 2023 23:11
docs/design/generics/overview.md Outdated Show resolved Hide resolved
docs/design/generics/overview.md Outdated Show resolved Hide resolved
docs/design/generics/overview.md Outdated Show resolved Hide resolved
docs/design/generics/overview.md Outdated Show resolved Hide resolved
Comment on lines 372 to 375
A function can have a mix of checked, template, and regular parameters. A
checked parameter is defined using a symbolic binding pattern, a template
parameter using a template binding pattern, and a regular parameter using a
runtime binding pattern. Likewise, it's allowed to pass a symbolic or template
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
A function can have a mix of checked, template, and regular parameters. A
checked parameter is defined using a symbolic binding pattern, a template
parameter using a template binding pattern, and a regular parameter using a
runtime binding pattern. Likewise, it's allowed to pass a symbolic or template
A function can have a mix of checked, template, and regular parameters. A
checked parameter is defined using a symbolic binding pattern, a template
parameter is defined using a template binding pattern, and a regular parameter is defined using a
runtime binding pattern. Likewise, it's allowed to pass a symbolic or template

I originally read this as

A checked parameter is defined using (a symbolic binding pattern, a template parameter using a template binding pattern, and a regular parameter using a runtime binding pattern).

Alternatively, I think something like this could work:

Each kind of parameter is defined using a different syntax: a checked parameter is uses a symbolic binding pattern, a template parameter uses a template binding pattern, and a regular parameter uses a runtime binding pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used the alternative, but also noticed I needed to update the next sentence.

josh11b and others added 2 commits August 14, 2023 22:01
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
@josh11b josh11b requested a review from zygoloid August 15, 2023 05:06
@zygoloid zygoloid added this pull request to the merge queue Aug 15, 2023
Merged via the queue into carbon-language:trunk with commit e15bdbb Aug 15, 2023
6 checks passed
@josh11b josh11b deleted the overview branch August 15, 2023 20:32
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.

2 participants