<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=""><div class="">cc'ing the list back in to catch up on this.</div><div class=""><br class=""></div><div class="">-- E</div><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 16, 2016, at 10:54 AM, Chris Wood <<a href="mailto:chris@interealtime.com" class="">chris@interealtime.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I really need to remember the “reply to all” button for these mailing lists. *Facepalm* :)</div><div style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div class="unibox-signature" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="color: rgb(54, 61, 76);" class="">Chris</span></div><div style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><blockquote type="cite" class="unibox-hidden" style="margin: 0px; padding: 0px 0px 0px 12px; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(170, 170, 170); color: rgb(170, 170, 170); font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="">On Mar 16, 2016, at 4:25 PM, Chris Wood <<a href="mailto:chris@interealtime.com" class="">chris@interealtime.com</a>> wrote:</div><div class=""><br class=""></div><div style="font-family: -apple-system, Helvetica, Arial, sans-serif;" class="">I suspect it does (haven’t tested it), but the chances of there being a function that returns Void and a line of code that returns Void are fairly good (especially in UI code).</div><div style="font-family: -apple-system, Helvetica, Arial, sans-serif;" class=""><br class=""></div><div class="unibox-signature" style="font-family: -apple-system, Helvetica, Arial, sans-serif;"><span style="color: rgb(54, 61, 76);" class="">Chris</span></div><div style="font-family: -apple-system, Helvetica, Arial, sans-serif;" class=""><br class=""></div><blockquote type="cite" class="" style="margin: 0px; padding: 0px 0px 0px 12px; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(170, 170, 170); color: rgb(170, 170, 170); font-family: -apple-system, Helvetica, Arial, sans-serif;"><div class="">On Mar 16, 2016, at 4:16 PM, Erica Sadun <<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>> wrote:</div><div class=""><br class=""></div><div class="" style="font-family: -webkit-standard;">Well that makes sense to me honestly unless you think there should be some condition that </div><div class="" style="font-family: -webkit-standard;">a return value should at least start on the same line as the return keyword. Although you'd</div><div class="" style="font-family: -webkit-standard;">think the closure would know if it's -> Void or -> T and parse the return accordingly</div><div class="" style="font-family: -webkit-standard;"><br class=""></div><div class="" style="font-family: -webkit-standard;">-- E</div><br class="" style="font-family: -webkit-standard;"><div style="font-family: -webkit-standard;" class=""><blockquote type="cite" class="" style="margin: 0px; padding: 0px 0px 0px 12px; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(170, 170, 170); color: rgb(170, 170, 170);"><div class="">On Mar 16, 2016, at 9:37 AM, Chris Wood <<a href="mailto:chris@interealtime.com" class="">chris@interealtime.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;">Erica:</div><div class="" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;"><br class=""></div><div class="" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;">The return case is (supposedly) handled as a compiler warning. It does warn that code on following lines will be treated as an argument to the return call normally (it does in a simple test project or playground). Except in the code I’m working on, it didn’t warn and happily compiled (and there was much swearing as a result!)</div><div class="" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;"><br class=""></div><div class="" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;">That looks like a compiler bug, and I’ve filed a radar (25192157) already.</div><div class="" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;"><br class=""></div><div class="" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;">Personally I think the compiler warning (when it works) and a trailing semicolon is acceptable in this case (as there may be a time when I want arguments to ‘return’ on the next line for some obscure reason).</div><div class="" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;"><br class=""></div><div class="unibox-signature" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;"><span class="" style="color: rgb(54, 61, 76);">Chris Wood</span></div><div class="unibox-signature" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;"><span class="" style="color: rgb(54, 61, 76);"><br class=""></span></div><div class="unibox-signature" style="font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;"><span class="" style="color: rgb(54, 61, 76);"><br class=""></span></div><blockquote type="cite" class="" style="margin: 0px; padding: 0px 0px 0px 12px; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(170, 170, 170); color: rgb(170, 170, 170); font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 14px;"><div class="">On Mar 16, 2016, at 3:30 PM, Erica Sadun <<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>> wrote:</div><div class=""><br class=""></div><div class="" style="font-family: -webkit-standard;">-1</div><div class="" style="font-family: -webkit-standard;"><br class=""></div><div class="" style="font-family: -webkit-standard;">I think end-of-line semicolons are ugly. I also think the decision to use them or not use them<br class="">should be left to individuals and not enforced by the compiler.</div><div class="" style="font-family: -webkit-standard;"><br class=""></div><div class="" style="font-family: -webkit-standard;">In the current implementation a semicolon can be optionally added after any statement and<br class="">is proactively used to separate statements on a single line. Changing the language to enforce<br class="">what appears to be a style choice is not something I'd support.</div><div class="" style="font-family: -webkit-standard;"><br class=""></div><div class="" style="font-family: -webkit-standard;">The issue with the return needing a semicolon sounds odd to me. I'm curious as to whether<br class="">that's something that needs fixing.</div><div class="" style="font-family: -webkit-standard;"><br class=""></div><div class="" style="font-family: -webkit-standard;">-- E</div><blockquote class="" style="margin: 0px; padding: 0px 0px 0px 12px; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(170, 170, 170); color: rgb(170, 170, 170); font-family: -webkit-standard;"><div class=""><br class=""></div><div class="">On Mar 16, 2016, at 9:25 AM, Chris Wood via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><br class=""></div><div class="">A word of warning on this - I’ve just hit a case where an end of line semicolon is actually critical!</div><div class=""><br class=""></div><div class="">If you’re debugging and need an early exit from a function, you add “return” somewhere in the middle of the code. But return can take an argument, so the compiler takes the argument from the following line which you think won’t be executed. Bad things happen, followed by swearing.</div><div class=""><br class=""></div><div class="">So in that particular case, you do in fact need to write:</div><div class=""><br class=""></div><div class="">return;</div><div class=""><br class=""></div><div class="">There may be other edge cases where it’s necessary to explicitly mark the end of something in the same way.</div><div class=""><br class=""></div><div class="">Chris Wood</div><div class=""><br class=""></div><div class=""></div><blockquote class="" style="margin: 0px; padding: 0px 0px 0px 12px; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(170, 170, 170); color: rgb(170, 170, 170);"><div class=""><br class=""></div><div class="">Hi,</div><div class=""><br class=""></div><div class="">I submitted a PR with a proposal to remove the swift end of line semicolons.</div><div class=""><br class=""></div><div class="">It was rejected because i didn't discuss it here. So here i'm discussing it :)</div><div class=""><br class=""></div><div class="">My proposal is simple: remove the semicolons in the end of lines.<br class="">It isn't needed and makes the code ugly.<br class="">It must be decided wether to use it or not for every project we start in the coding style.</div><div class=""><br class=""></div><div class="">What do you think?</div><div class=""><br class=""></div><div class="">João Nunes</div><div class=""><br class=""></div><div class=""></div><div class=""><br class=""></div><div class="">Sent from my iPhone</div><div class=""><br class=""></div><div class=""></div><div class=""><br class=""></div><div class=""></div></blockquote><div class=""><br class=""></div><div class=""></div><div class=""><br class=""></div><div 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" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></blockquote></div></blockquote></div></blockquote></blockquote></div></blockquote></div><br class=""></body></html>