[Pitch] Parameter Packs

The natural spelling would be, I suspect then, many Ts—that is, I suspect English grammar will strongly tilt the debate about whether or not to use the plural for a parameter pack name if we choose this spelling. It doesn't really scale though to, say, container types as one can't pluralize the base: many Sequence<Ts> doesn't read obviously more clearly than many Sequence<T>.

It could also, I think, nudge us towards a different operator to expand a pack, which might not be a bad thing. Suppose that's something like each. We could end up with something that reads a little AppleScript-y:

func allEmpty<many T>(_ arrays: [each T]) -> Bool {
    var result = true
    for each array in many arrays {
        result &&= array.isEmpty
    }
    return result
}
4 Likes