<div dir="ltr">Good point Jordan. I think what Jakob was trying to say is that &#39;else if&#39; is already a language construct, and thus it might be easier on the eye to see &#39;if cond then expr1 else if cond2 then expr2 ...&#39;, than to see &#39;cond1 ? expr1 : cond2 ? expr2 : ...&#39;</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 14, 2015 at 6:38 PM Jordan Rose via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Dec 13, 2015, at 8:11, Jakob Egger via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">But there is one good side to this proposal: it nests more naturally than the ternary operator:</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">&quot;if cond then expr1 else if cond2 then expr2 else expr3&quot;</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">vs.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">&quot;cond ? expr1 : (cond2 ? expr2 : expr3)</div><br></div></blockquote></div><br></div><div style="word-wrap:break-word"><div>Without commenting on anything else in this thread, ?: nests properly (right-associative-ly) in every languageĀ <a href="http://www.phpsadness.com/sad/30" target="_blank">other than PHP</a>. Dropping the parens there is equivalent.</div><div><br></div><div>(That said, if I hadn&#39;t known that already it wouldn&#39;t have been something I could infer from the syntax. I&#39;d have to assume the author knew what they were doing. And I&#39;m the sort who will parenthesize &amp;&amp; expressions within || expressions, even though it&#39;s not strictly necessary.)</div><div><br></div><div>Jordan</div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=8CZIdLciSFC-2BO5jF-2FiP8qN7dBFsgCUZ50wdTsolcRPcA-2F7OWto9c4Let4DkdMywafTAPp9tMqcKxb0e1FPJSB93qCWdFsle5cgi1jyTjrphroqSiz6gYS24c-2BYeUy2sFuPmyRFMAu0oW5Ope2EfGWUOkpTstMXF6miZiIJxQ6uTpJx46-2B8q6-2FJMZbsPut4kuWqPL-2FoWkkAYjsddnb0Rt3HXSj3eiY70GvYfTZrOK9yQ-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">
</div>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>