<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 29, 2016, at 5:14 PM, Allen Ding &lt;<a href="mailto:allen@snappymob.com" class="">allen@snappymob.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">1. Is there some data or real world story to support (1)? I've never had the same expectations even when first encountering Swift and definitely less so after reading the documentation, because the concept and syntax for inout and &amp; is not really profound. And even if I did *pointers!*, I would figure things out rather quickly because nothing else would work.</div></div></blockquote><div><br class=""></div>Going from personal experience?</div><div><br class=""></div><div><a href="http://ericasadun.com/2015/04/10/swift-var-parameters/" class="">http://ericasadun.com/2015/04/10/swift-var-parameters/</a></div><div><br class=""></div><div>-- E, "professionally dense"</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">(2. I don't have experience with Rust, so there would need to be some details on why being more Rust like is a good thing :)</div><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Jan 30, 2016 at 7:50 AM, Erica Sadun via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">The great advantages are:</div><div class=""><br class=""></div><div class="">1. It removes a potentially confusing overlap with C-style expectations. People see &amp; and think "POINTERS!", which is not how things work in Swift with copy-back.</div><div class="">(2. It eventually frees up &amp;, so we can have more Rust)</div><span class=""><font color="#888888" class=""><div class=""><br class=""></div><div class="">-- E</div></font></span><div class=""><div class=""><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On Jan 29, 2016, at 4:42 PM, Charles Kissinger &lt;<a href="mailto:crk@akkyra.com" target="_blank" class="">crk@akkyra.com</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" class="">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 class=""><div class=""><br class=""></div><div class="">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;'.</div><div class=""><br class=""></div><div class="">—CK</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 29, 2016, at 2:13 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" target="_blank" class="">erica@ericasadun.com</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 29, 2016, at 3:04 PM, Charles Kissinger &lt;<a href="mailto:crk@akkyra.com" target="_blank" class="">crk@akkyra.com</a>&gt; wrote:</div><div class=""><div style="word-wrap:break-word" class=""><div class="">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 class=""></div></div></div></blockquote><br class=""></div><div class="">If you have a function</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">f(x: Int) {}</font></div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Now consider</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">f(x: inout Int) {}</font></div><div class=""><br class=""></div><div class="">you call it with f(&amp;y) or f(inout y), and with a label, you'd call it f(x: &amp;y) or f(x: inout y).</div><div class=""><br class=""></div><div class="">It seems &nbsp;consistent to me.</div><br class=""></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></div><br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div></div></div>
</div></blockquote></div><br class=""></body></html>