<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="">+1 to the arguments of Robert and Xiaodi<div class=""><br class=""></div><div class="">-Thorsten</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 11.02.2016 um 18:46 schrieb Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>>:</div><br class="Apple-interchange-newline"><div class="">I believe this has already been proposed on the list in the past. I don't have easy access to the archives at the moment so I can't provide a convenient link.<br class=""><br class="">The gist of it--or at least one of the compelling arguments against the idea--was that the 'obvious' implicit behavior becomes non-obvious when you take into account guard statements inside loops, for example. Do you continue? break? return? And once you make a decision for each of the scenarios envisioned you end up with a complicated series of fallbacks that need extensive documentation, which is no longer much of a win over explicitly writing your fallback.<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, Feb 11, 2016 at 11:38 AM Developer via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class="">I agree the nil fallback case is a common one, but the loss of readability and decreased understanding of control flow here makes me think special-casing this isn't all it's cracked up to be.</div><div class=""><br class=""></div><div class="">~Robert Widmann</div><div class=""><br class="">2016/02/10 22:40、Tighe Racicot via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> のメッセージ:<br class=""><br class=""></div></div><div dir="auto" class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">Hey everyone, <div class=""><br class=""></div><div class="">I feel that `guard` could be a little more Swifty and would like to start a conversation concerning it.</div><div class=""><br class=""></div><div class="">For example, I often have a function whose job depends on an optional having a value, and so I guard-let at the start and return if the guard fails. Or if the function returns an optional type, I'll simply return nil if guard fails. </div><div class=""><br class=""></div><div class="">Can we improve on the general fallback case? Could we simply say:</div><div class=""><br class=""></div>func noReturn() {<br class=""> guard let aValue = someOptional<br class=""><div class=""> ....</div><div class="">}</div><div class=""><br class=""></div><div class="">and have that imply "else { return <i class="">void or nil</i> }"</div><div class=""><br class=""></div><div class="">What are your thoughts?</div><div class=""><br class=""></div><div class="">Tighe</div><div class=""><br class=""></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" target="_blank" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" 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" 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="">
</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="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>