SE-0330: Conditionals in Collections

I'm rather baffled about this particular proposal coming to review.

The pitch thread was some (over three?) years ago and basically ended with a note from @Chris_Lattner3 summarizing the core team's decision that a larger discussion surrounding #if was called for as the original design goals are now obsolete. I don't recall seeing any further discussion on that point.

I do agree, as I did then, that the addition itself is small and seemingly obvious. During the pitch phase, several questions about whether certain corner cases ought or ought not to be accepted were posed. The proposal, as presented today for review, does not answer those questions even years later. Specifically:

It's unclear where the proposal comes down re @rintaro's points in this post regarding whether commas are necessary in those examples.

Additionally, there's never been an answer regarding this example:

Moreover, these questions are not answerable by using a toolchain with a draft implementation to test the proposed behaviors, since there isn't one (the referenced PR has been closed for a long time).

So my overall evaluation would be that I would love to see some progress in this area, and the problem addressed is significant enough that an unobtrusive, limited addition to the language would be warranted. Indeed, the examples given in the proposal do fit well with the feel and direction of Swift; however, these examples do not completely specify an implementable result, and the original implementation caused concern to the core team and is now long since obsolete.

I have obviously used corresponding features in other C-family languages; this is a nice step towards adding some of the flexibility in those languages but, as the core team judged many years ago, a wholesale reconsideration is due here. I read this iteration of the proposal thoroughly and went back to study the prior thread as well as the PR that's now closed.

11 Likes