swift-book icon indicating copy to clipboard operation
swift-book copied to clipboard

Add a paragraph about pack iteration [SE-0408]

Open simanerush opened this issue 1 year ago • 5 comments

Add information to the for-in statement that the expression may also be a pack expansion expression, according to SE-0408.

Marking this draft for now, but hoping to get this merged once #67594 lands.

simanerush avatar Nov 12 '23 07:11 simanerush

Thanks for the draft!

I think this change is small enough to land in the reference on its own. Separately, we can add for loops to the the outline in https://github.com/apple/swift-book/pull/174, which discusses parameter packs to the guide.

EDIT: I see the linked implementation PR is merging into 'main', which would include this functionality in Swift 6. We'll want to keep this branch open until the feature is lined up to ship in the next Swift beta, which often means waiting for the implementation to be cherry-picked into the 'release/5.10' branch.

amartini51 avatar Nov 13 '23 17:11 amartini51

@amartini51 Great, thank you! I don't think there are any more things I'd like to add here, so marking this "ready for review"🙂

simanerush avatar Nov 13 '23 18:11 simanerush

If you don't mind, I'm moving this back to Draft until the compiler implementation lands. We wouldn't want to ship documentation for a feature that developers can't use yet.

amartini51 avatar Nov 13 '23 19:11 amartini51

The compiler PR has been merged to 'main' so marking this ready for review. We may need to not actually merge it yet though — the SE proposal says it's for the next version of Swift after 5.10.

amartini51 avatar Jan 04 '24 00:01 amartini51

Yes, let's wait until the feature is shipped🙂

simanerush avatar Jan 04 '24 00:01 simanerush

@simanerush SE-0408 is marked as implemented in Swift 6.0 now — is this PR still ready to review, or is there anything you want to revise?

amartini51 avatar Jun 25 '24 22:06 amartini51

Cherry picked this PR's changes as 07b58edbdcfc5e928aa3e2cefe931b70b34675d4 — we will coordinate making both sets of changes on one branch.

amartini51 avatar Jul 02 '24 23:07 amartini51