<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="">I don’t have a problem with “guard”, and I have grown used to it, but I will give you that “ensure” is probably clearer. “ensure *this condition is true*”, “ensure that I can let foo = bar” — seems easier to conceptualize its meaning from syntax than “guard”…</div><div class=""><br class=""></div><div class="">The only problem I have is that “ensure” exists in a different language I know (Ruby), where it has different meaning.</div><div class=""><br class=""></div><div class="">So… I’m not sure it’s worth changing “guard” now and I probably wouldn’t be *for* the change, but I also probably wouldn’t argue against it either ;)</div><br class=""><div class="">
<div class="">— Radek</div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 19 Feb 2016, at 22:49, John Flanagan 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=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The functionality of ‘guard’ is great and this proposal has nothing to do with changing that. The only suggestion is that the word ‘ensure’ would better communicate what a ‘guard’ statement does to those encountering it for the first time and would make code more readable in general.<div class=""><br class=""></div><div class="">Example:</div><div class=""><br class=""></div><div class=""><font face="Courier" class="">ensure foo != nil else {</font></div><div class=""><font face="Courier" class=""> return;</font></div><div class=""><font face="Courier" class="">}</font></div><div class=""><br class=""></div><div class="">-John</div></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=""></body></html>