<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="">If functions start using shorthand argument names, I would probably feel more comfortable with it. Is that being discussed?<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 3, 2016, at 5:22 PM, T.J. Usiyan &lt;<a href="mailto:griotspeak@gmail.com" class="">griotspeak@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">+1 for both. I don't think that I would prefer the $0 syntax in most cases but I would appreciate making the syntax more consistent.<div class=""><br class=""></div><div class="">TJ</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Feb 3, 2016 at 5:08 PM, Jessy Catterwaul 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="">+1 on implicit return</div><div class="">-1 on $0; I like newValue more than it.</div><div class=""><br class=""></div><div class="">I also think the return <u class="">type</u> should be implicit.</div><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On Feb 3, 2016, at 5:00 PM, Chris Liscio via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5"><div style="word-wrap:break-word" class=""><div class="">Why can’t we use shorthand argument names and implicit returns when specifying the get and set blocks in a computed property? I.e., Why must we refer to newValue in the implementation of set, and not $0 like we do in closures? Also, why do we need ‘return’?</div><div class=""><br class=""></div><div class="">Once you get used to the shorthand, you kinda want to use it all over…</div><div class=""><br class=""></div><div class="">This question came up recently when I was writing a façade for another class, and would have liked to written something like the following:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">class Façade {</font></div><div class=""><font face="Menlo" class="">&nbsp; private var _wrapped: Something</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">&nbsp; var wrappedProperty: Int {</font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp; get { _wrapped.property }</font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp; set { _wrapped.property = $0 }</font></div><div class=""><font face="Menlo" class="">&nbsp; }</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">&nbsp; var multipliedProperty: Int { _wrapped.property * 42 }</font></div><div class=""><font face="Menlo" class="">}</font></div><div class=""><br class=""></div>I apologize if this has already been discussed/requested before. I searched the archives and didn’t turn up anything that referred to this specifically.<div class=""><br class=""></div><div class="">Thanks!</div><div class=""><br class=""></div><div class=""><div class="">Chris Liscio</div><div class=""><a href="http://supermegaultragroovy.com/" target="_blank" class="">http://supermegaultragroovy.com</a></div><div class="">Learn _your_ music with Capo: <a href="http://capoapp.com/" target="_blank" class="">http://capoapp.com</a></div></div><div class=""><br class=""></div></div></div></div>_______________________________________________<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" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div><br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" 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></blockquote></div><br class=""></div></body></html>