Another attempt at passing arrays as varargs (with implementation)

We only have one instance in the standard library where the same spelling is used for two semantically distinct operators: the string concatenation operator + and addition operator +. This has been noted several times on this list to be a mistake that's too late to correct.

I would be reticent to see another such issue deliberately created with ..., and I've yet to see any reason to prefer it over another very common spelling for splatting, unary *. At least with the latter spelling there isn't already a unary operator in the standard library that's spelled the same way.

That said, even with unary *, it is (or was) the plan of record to use an operator for tuple splatting. I think it's an open question whether we want to use the same spelling for the much more restrictive (in the sense that it requires homogeneous arguments, and in the sense that it'd be used specifically to forward as a variadic argument) array splatting. Doing so now could preclude an elegant syntax for explicit tuple splatting (which I very much hope will come back).

This is all to say that even if there were no type checking performance problems, I can see several reasons why ... or even another operator would have drawbacks here.

3 Likes