<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br>On 18 May 2015, at 17:30 , Marco Servetto <<a href="mailto:marco.servetto@gmail.com">marco.servetto@gmail.com</a>> wrote:<br><br><blockquote type="cite">On 19 May 2015 at 12:18, Andrew P Black <<a href="mailto:andrew.p.black@gmail.com">andrew.p.black@gmail.com</a>> wrote:<br><blockquote type="cite">On the whole, variable arity methods seem better than the alternative,<br>which is to privilege one kind of collection by giving it a special syntax.<br></blockquote><br><br>Ok, so... what kind of collection is used when the method body tries<br>to read that parameter?<br></blockquote><br><div>We tell the programmer that the interface is defined by the Sequence type. So yes, in a sense we are privileging that kind of collection. But the implementation need not actually reify it. If set, for example, is implemented by a built-in library that has low-level access to the constructor arguments, then the set could be built directly without the need to build a sequence along the way. In general, because the collection of arguments is built by the invoked method, rather than by the requester, a reasonable compiler could do some escape analysis and avoid building any object in most cases.</div><div><br></div><div>Variable arity methods also make the syntax seen by the requester more uniform. The requestor writes set.with(4, 5, 6), list.with(4, 5, 6) and sequence.with(4, 5, 6) rather than set.with[4, 5, 6], list.with[4, 5, 6] and [4, 5, 6]. Although, as you point out, on the <i>implementers</i> side Sequence is still privileged.</div><div><br></div><div>I'm more concerned with uniformity for the use than for the implementor. And although implementation efficiency is not our primary concern, it's nice to pick the alternative that keeps more options open for the implementer.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Andrew</div><div><br></div></body></html>