swift-book
swift-book copied to clipboard
Add a paragraph about pack iteration [SE-0408]
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.
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 Great, thank you! I don't think there are any more things I'd like to add here, so marking this "ready for review"🙂
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.
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.
Yes, let's wait until the feature is shipped🙂
@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?
Cherry picked this PR's changes as 07b58edbdcfc5e928aa3e2cefe931b70b34675d4 — we will coordinate making both sets of changes on one branch.