[Accepted with Modifications] SE-0393: Value and Type Parameter Packs

The review of SE-0393: Value and Type Parameter Packs ran from March 21...April 3, 2023.

Feedback was overall quite positive; minor drafting clarifications were applied to the text mid-review, and the language workgroup decided to accept the proposal with modifications to the substantive design to be incorporated as follows:

  • As originally proposed, pack references (each S) could appear in generic requirements without the use of an explicit repeat (func zip<each S>(...) where each S: ...). An explicit repeat is important to avoid ambiguities in other contexts, and as it turns out, allowing generic requirements to elide repeat can also cause ambiguities in local generic functions. Therefore, the language workgroup agrees that generic requirements should also require explicit repeat.

  • The language workgroup agrees that a fixed-arity overload is intuitively "more specialized" than an overload which uses parameter packs. It's also an important use case for authors to be able to add variadic overloads of existing functions without having to "pad" the parameter list with mandatory scalar parameters or to fiddle with availability annotations in order to avoid call-site ambiguities. Therefore, we've requested that the proposal be modified to include overload resolution rules that favor fixed-arity overloads. As "soft-banning" same-module overloads won't eliminate the problem, we don't think that such a measure would be part of the the right solution.

Overall, we were pleased to hear that reviewers who tried out the nightly toolchains found in their experience that the proposed syntax was quite usable and intuitive. A number of suggestions regarding alternatives for syntax were put forward (e.g.: repeating, many/multiple, pack/unpack, fold, expand, variadic) with varying degrees of rationale, but the language workgroup did not find that one alternative was persuasively better than the option proposed.

As always, thank you for participating in the review process.

Xiaodi Wu
Review Manager

14 Likes

I would also encourage all to follow along and contribute to ongoing pitches that build on this feature:

8 Likes