<div dir="ltr">Please see my proposal and the associated discussion thread at &quot;[Proposal] Use inout at function call sites&quot;.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 29, 2016 at 6:42 PM, Charles Kissinger via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Sorry, I wasn’t clear at all there. I was thinking of the most common case where there is either only one parameter or the inout parameter is the first one. Then there will typically be no argument label involved at the call site. In that case ‘inout’ will be the first word inside the parens at the call site (assuming it replaces ‘&amp;’). If it also is kept in its current position in function declarations, it will be in that same leading position in declarations and (I’m assuming) people will have an easy time remembering where to put it.<div><div><br></div><div>When there is a label involved, it is a different story. I was implicitly, and probably wrongly, assuming that would be a much less common case in practice. A poorly worded, and probably poorly reasoned, argument on my part, though I still don’t see any great advantage to replacing ‘&amp;&#39;.</div><div><br></div><div>—CK</div><div><div class="h5"><div><br><div><blockquote type="cite"><div>On Jan 29, 2016, at 2:13 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" target="_blank">erica@ericasadun.com</a>&gt; wrote:</div><br><div><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Jan 29, 2016, at 3:04 PM, Charles Kissinger &lt;<a href="mailto:crk@akkyra.com" target="_blank">crk@akkyra.com</a>&gt; wrote:</div><div><div style="word-wrap:break-word"><div>The related idea of replacing ‘&amp;’ with ‘inout’ at the call site seems completely contradictory to this proposal. Developers would then have to remember that the ‘inout’ goes before the argument at the call site but after it in the function definition. That seems like a constant source of mis-typings and something that would be viewed as an inconsistency in the language. Or do people want to put it after the argument name at the call site too? It seems a little like change just for the sake of change, IMO.<br></div></div></div></blockquote><br></div><div>If you have a function</div><div><br></div><div><font face="Menlo">f(x: Int) {}</font></div><div><br></div><div>you call it with f(8), and potentially f(x: 8). Even when labeled, the 8 value is to the right of the colon.</div><div><br></div><div>Now consider</div><div><br></div><div><font face="Menlo">f(x: inout Int) {}</font></div><div><br></div><div>you call it with f(&amp;y) or f(inout y), and with a label, you&#39;d call it f(x: &amp;y) or f(x: inout y).</div><div><br></div><div>It seems  consistent to me.</div><br></div></div></blockquote></div><br></div></div></div></div></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Trent Nadeau</div>
</div>