<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>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 id="AppleMailSignature"><br></div><div id="AppleMailSignature">~Robert Widmann</div><div><br>2016/02/10 22:40、Tighe Racicot via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> のメッセージ:<br><br></div><blockquote type="cite"><div><div dir="ltr">Hey everyone, <div><br></div><div>I feel that `guard` could be a little more Swifty and would like to start a conversation concerning it.</div><div><br></div><div>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><br></div><div>Can we improve on the general fallback case? Could we simply say:</div><div><br></div>func noReturn() {<br> guard let aValue = someOptional<br><div> ....</div><div>}</div><div><br></div><div>and have that imply "else { return <i>void or nil</i> }"</div><div><br></div><div>What are your thoughts?</div><div><br></div><div>Tighe</div><div><br></div></div>
</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>