<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="">I’m not sure about the single line aspect of this proposal, but I am a big proponent of “unless” and “until” as complements to “if” and “while”. They greatly improve readability over "if !(expression)” and “while !(expression)” IMHO.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 12, 2015, at 9:45 AM, Arthur Ariel Sabintsev via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">For your specific example, I'd 100% use the guard statement. It achieves the same result.<br class=""><br class="">-1 from me.<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Sat, Dec 12, 2015 at 9:43 AM J. Cheyo Jimenez 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="ltr" class="">-1 from me. I think I would rather have an if-then expression that would handle both False and True cases. <div class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001944.html" target="_blank" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001944.html</a><br class=""><div class=""><br class=""></div><div class="">Also, in most cases I feel that guard would be a better choice. <div class=""><br class=""></div><div class=""><br class=""></div></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Dec 12, 2015 at 5:39 AM, James Campbell via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I propose adding the unless and if statements from ruby.<br class="">
<br class="">
Return false if james = nil<br class="">
<br class="">
This returns false if the variable James is nil<br class="">
. This line does it unless james is nil:<br class="">
<br class="">
Return false unless james = nil<br class="">
<br class="">
This has been really handy when working in ruby, reduces lines and pyramids of doom<br class="">
<br class="">
Sent from my iPhone<br class="">
_______________________________________________<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=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=QOj-2FXWMwrtGhHdk0ao-2FYqYPqIFSXRT0DG7Sea-2BCcxJN8c5RRhyvxdcersifGUQfEvSKA-2BcBWhD1IL2gdIk1Z0CqzR9cyYlLS6x2ISqAdFeWy8udykQsTYlY5El02WDIqpG7sRXq-2BJZwOCAxhwCrfyRgVMAG6-2FcFCyxFMDMuAC2m2vuiSL3IEmYfF1-2BnU827NC1-2FOUujQ-2B1nncjE3VhzlbBhcHN6AHbj9MPAYz-2B8du-2BQ-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
_______________________________________________<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>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=eLFMrKDT8iBxZ-2Fbnk-2BZqvSchNN-2FvYXdceA0T7VxwkAdRcwxCUln-2FYz-2Fh7rYWT7qE6p-2B874XipoMU74xFpMCSJydD2kD2vFmE5NVfH5Crm0CTQaIJQHSjECxlqhC8kxJzzw0RQfQSu44g6CI-2BEJvEcZ7DIg4SDzpvBdj3IEw-2BsEZBa0HpJs1Eem6Z1hJIzxa5dd-2ByS1PPj1PhhbGHWtTsuj1KGFIeTCXeikNhG8xjeKc-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" 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></blockquote></div><br class=""></div></body></html>