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

Add documentation for parameter packs #174

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

amartini51
Copy link
Member

Fixes: rdar://102835487

Co-authored-by: Holly Borla <hborla@apple.com>
the `repeat` operator must appear first.
(So `repeat try each foo` or `repeat each try foo`)

- All of the `each` expressions in a parameter-pack expression

Choose a reason for hiding this comment

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

I'm having a similar reaction to the hyphen in parameter-pack here, but am starting to wonder whether this is just my lack of familiarity with our formal documentation and this is some convention in certain circumstances? Because I am not seeing the hyphen used in parameter-pack elsewhere in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

In these cases 'parameter pack' is being used as a compound adjective, so it should be hyphenated. My favorite case is something like 'drag and drop' vs. 'drag-and-drop operation': https://support.apple.com/guide/applestyleguide/d-apsg7af4f5d0/1.0/web/1.0#:~:text=drag-and-drop

Copy link
Member

Choose a reason for hiding this comment

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

I think what's strange here is the overall term "parameter-pack expression". We should call it the "pattern expression".

Copy link
Contributor

@krilnon krilnon Aug 23, 2023

Choose a reason for hiding this comment

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

(No opinion here either way, but there might be confusion with this other meaning of pattern: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/patterns , although 'pattern expression' isn't used in that context. Edit: That chapter does have 'expression pattern'.)

the whole line is duplicated once for each type.
When you use `repeat` in the middle of a line (as an expression),
it expands to make a tuple
with one tuple element for each type.

Choose a reason for hiding this comment

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

Hmm... only if you have done so within tuple parentheses?

simanerush and others added 2 commits July 2, 2024 15:55
Removed stray whitespace at end of lines.  Restored line breaks for
unchanged content.  Split lines in new content at clause and sentence
boundaries, instead of wrapping at 80 columns.
@simanerush simanerush force-pushed the pack_102835487 branch 3 times, most recently from d2a7c35 to be77ed9 Compare August 8, 2024 01:20
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.

6 participants