<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 23, 2017, at 1:24 AM, Georgios Moschovitis 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=""><div class="">Copied from the corresponding Github issue, I would like to hear opinions from the broader community on this:<br class=""><br class="">I am wondering if the correct 'translation' to Swift of:<br class=""><br class="">```<br class="">onNext()<br class="">onError()<br class="">```<br class=""><br class="">is really:<br class=""><br class="">```<br class="">on(next:)<br class="">on(error:)<br class="">```<br class=""></div></div></blockquote><div><br class=""></div><div>I’ve played around with reactive streams, and one of the main issues with this naming convention is that it really confuses the compiler when you try to use trailing closure syntax:</div><div><br class=""></div><div><font face="Menlo" class="">aStream.on { nextOrError in</font></div><div><font face="Menlo" class=""><br class=""></font></div><div><font face="Menlo" class="">}</font></div><div><br class=""></div><div>The compiler has a really hard time inferring what the type of <font face="Menlo" class="">nextOrError</font> is without explicitly typing the parameter or not using trailing closure syntax.</div><div><br class=""></div><div>Using <font face="Menlo" class="">.onNext { … }</font> or <font face="Menlo" class="">.onError { … }</font> bypasses this problem entirely.</div><div><br class=""></div><div>Dave</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="">maybe something closer to Foundation's naming conventions would be:<br class=""><br class="">```<br class="">didReceive(next:) or didReceive(value:)<br class="">didReceive(error:)<br class="">```<br class=""><br class="">-g.<br class=""><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="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></div></blockquote></div><br class=""></body></html>