<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><blockquote type="cite" class=""><div class="">Am 13.12.2015 um 15:11 schrieb Marc Knaup via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; 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="">** Keyword<span class="Apple-converted-space">&nbsp;</span><font face="monospace, monospace" class="">then</font><span class="Apple-converted-space">&nbsp;</span>**</div><div style="font-family: Helvetica; font-size: 12px; 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="">Making then a keyword would also cost us another word so that change needs to be carefully considered.</div><div style="font-family: Helvetica; font-size: 12px; 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="">In our large app I found just a single instance where<span class="Apple-converted-space">&nbsp;</span><font face="monospace, monospace" class="">then</font><span class="Apple-converted-space">&nbsp;</span>was used for a variable's name:</div><div style="font-family: Helvetica; font-size: 12px; 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=""><span class=""><br class=""></span></div><div style="font-family: Helvetica; font-size: 12px; 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=""><font face="monospace, monospace" class=""><span class="">func</span><span class=""><span class="Apple-converted-space">&nbsp;</span>reloadConfigurationAndThen(then:<span class="Apple-converted-space">&nbsp;</span></span><span class="">() -&gt; Void</span><span class="">) { … }</span></font><br class=""></div><div style="font-family: Helvetica; font-size: 12px; 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=""><p class="">Promises use the word<span class="Apple-converted-space">&nbsp;</span><font face="monospace, monospace" class="">then</font><span class="Apple-converted-space">&nbsp;</span>rather extensively:<span class="Apple-converted-space">&nbsp;</span><a href="https://promisesaplus.com/" class="">https://promisesaplus.com</a></p></div></div></blockquote></div>That’s a good point, Marc!<br class=""><div><blockquote type="cite" class=""></blockquote></div><div class=""><br class=""></div><div class="">In that case we should probably refrain from introducing „then“ (or can the parser differentiate these usages, so that „then“ is still available for variables?</div><div class=""><br class=""></div><div class="">Rust is just using the statement form for the if-expression:</div><div class=""><br class=""></div><div class="">let x = if condition { … } else { … }</div><div class=""><br class=""></div><div class="">Rust allows having several statements in each block with the last having to be an expression which is used as value for the branch, effectively treating the { … } as closure and evaluating it for the branch executed.</div><div class=""><br class=""></div><div class="">Chris Lattner didn’t like using { … } in the if-expression, but I didn’t understand why, I have to admit.</div><div class=""><br class=""></div><div class="">-Thorsten</div></body></html>