<div dir="ltr">&quot;<span style="font-size:13px"> assign x to a if x is non-zero, otherwise make it equal to y</span>&quot;<div><br></div><div>You can&#39;t &quot;if&quot; anything other than a Bool.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 6, 2016 at 11:09 PM, John Randolph <span dir="ltr">&lt;<a href="mailto:jcr@icloud.com" target="_blank">jcr@icloud.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
&gt; On Jan 6, 2016, at 10:18 PM, Charles Constant via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt; let fb = pickOne ? “A&quot; : &quot;B&quot; : &quot;C&quot; : &quot;D&quot; : &quot;E&quot; : &quot;F&quot; : &quot;G” : _ ! &quot;Z&quot;<br>
&gt;<br>
<br>
</span>I think it’s worth mentioning that in C today (both in GCC and Clang), we can use the ternary operator in a shortened fashion like so:<br>
<br>
        a = x ?: y;<br>
<br>
which is equivalent to:<br>
<br>
        a = x ? x : y;<br>
<br>
<br>
Meaning, assign x to a if x is non-zero, otherwise make it equal to y.<br>
<br>
This construct occurs all over the place in my Obj-C code, and porting that to Swift today is perfectly straightforward.  If the ?: operator becomes the ?:::::: operator, then does this very common shorthand use of the existing ternary operator become impossible?<br>
<br>
I’m for keeping the ternary operator as it is.  Expanding it into a poor man’s switch() is unnecessary and has definite drawbacks.<br>
<br>
-jcr</blockquote></div><br></div>