SE-0231 — Optional iteration

Imho there is a solution that would make things simpler instead of introducing any inconsistency - and I'm quite surprised about how many people complain about added complexity in this thread:
My memory may fail me, but I don't remember many who voiced this concern when huge new concepts like dynamic member lookup and all those automatic conformances (Codable...) have been introduced.

I really think Swift has too many small and specialized solutions and that it would be better to invest time and energy in powerful and composable features - but I see the inconsistency in that you can write

for x in seq! {}

but not

for x in seq? {}

Afair there has been at least one thread about "optional chaining for parameters" (yes, I seem to be right ;-): [Idea] Use optionals for non-optional parameters, Optional Argument Chaining) and people really want such shortcuts - it's just not possible to add them with a semantic as clear as in the case we are talking about here.

2 Likes