<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Would this proposed syntax, using argument labels, also be available in function arguments?</div><div><br></div><div>e.g&nbsp;</div><div>func items(withCompletion completion<span style="background-color: rgba(255, 255, 255, 0);">(success:error:): ([Item]?, NSError?) -&gt; Void) {</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">&nbsp; ...</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">&nbsp; completion(success: items, error:nil)</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">&nbsp;}</span></div><div><br>On 22 Feb 2017, at 08:49, Charlie Monroe via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div class="">This was pointed out during the discussions surrounding this proposal and it was agreed that the type simplification was important.</div><div class=""><br class=""></div><div class="">There were several suggestions how to bring this back using different features - e.g. compound names that would contain the labels. For example:</div><div class=""><br class=""></div><div class="">let callback(success:error:): (Bool, Error?) -&gt; Void = ...</div><div class="">callback(success: true, error: nil)</div><div class=""><br class=""></div><div class="">This way the type itself wouldn't contain the label information, but the name of the variable would.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 22, 2017, at 9:41 AM, Goffredo Marocchi via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class="">I am quite interested in this as well, thanks for bringing it up! It was quite disappointing to fall back to multi argument method calls without labels as it was going against the emphasis on the value of labels in the language as well as decreasing readability of what is supposed to be self documenting code.<br class=""><br class="">Sent from my iPhone</div><div class=""><br class="">On 22 Feb 2017, at 08:36, Franklin Schrans via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">When&nbsp;<a href="https://github.com/apple/swift-evolution/blob/master/proposals/0111-remove-arg-label-type-significance.md" class="">SE-0111</a>&nbsp;was approved, I noticed the implication it had when using closures as callbacks:</div><div class=""><br class=""></div><div class="">Writing</div><div class=""><font face="Monaco" class="">&nbsp; &nbsp;func foo(completion: (success: Bool) -&gt; Void) {</font></div><div class=""><font face="Monaco" class="">&nbsp; &nbsp; &nbsp;completion(success: true)</font></div><div class=""><font face="Monaco" class="">&nbsp; &nbsp;}</font></div><div class=""><font face="Monaco" class=""><br class=""></font></div><div class="">is no longer possible, because function types can’t have argument labels anymore, and the function has to be written:</div><div class=""><div class=""><font face="Monaco" class="">&nbsp; &nbsp;func foo(completion: (Bool) -&gt; Void) {</font></div><div class=""><font face="Monaco" class="">&nbsp; &nbsp; &nbsp;completion(true)</font></div><div class=""><font face="Monaco" class="">&nbsp; &nbsp;}</font></div></div><div class=""><font face="Monaco" class=""><br class=""></font></div><div class="">which doesn’t look very nice, especially as the number of the arguments increases.</div><div class=""><br class=""></div><div class="">After talking to Chris Lattner about this, he referred me to&nbsp;<a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160711/024331.html" class="">this</a>&nbsp;email.</div><div class="">I was wondering if there's been any further work or plans in restoring the use of argument labels in closures.</div><div class=""><br class=""></div><div class="">- Franklin</div></div>
</div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div>_______________________________________________<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">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>