<div dir="ltr"><div><div><p style="font-size:13px;margin:0px;line-height:normal;font-family:Arial"><span style="font-family:arial,sans-serif;font-size:small">> </span><span style="font-family:arial,sans-serif">I see what you are trying to do, because of the colon being both used for switch cases and </span><br></p></div></div><div><span style="font-size:13px">> separators for the ternary and so there needs to be a new character for each case. </span></div><div><span style="font-size:13px">> I am not sure that putting colons between each case is really necessary though.</span></div><div><span style="font-size:13px"><br></span></div><div>Most of us (including you and I) like a form that starts with " let val = condition ? " like the existing ternary. Let's say a proposal like that gets accepted... I really believe "colons as separators" is the best idea in the case. Otherwise, it gets pretty confusing.. we'll have the existing ternary where a colon does one thing, and our new "extra ternary" where it does something else. </div><div><br></div><div>This is why I like colons (this won't make sense unless your email has rich text to show the colors): </div><div><br></div><div><div><p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;color:rgb(96,96,96)"><b><span class="" style="white-space:pre">        </span>let val = color ? </b></p><p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;color:rgb(96,96,96)"><b><span class="" style="white-space:pre">                </span></b><span style="color:rgb(227,36,0)"><b>.Red !</b></span><b> <span class="" style="white-space:pre">        </span>0xFF0000 : </b></p><p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;color:rgb(96,96,96)"><b><span class="" style="white-space:pre">                </span></b><span style="color:rgb(227,36,0)"><b>.Green !</b></span><b> <span class="" style="white-space:pre">        </span>0x00FF00 : </b></p><p style="font-size:13px;margin:0px;line-height:normal;font-family:Arial">
</p><p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;color:rgb(96,96,96)"><b><span class="" style="white-space:pre">                </span></b><span style="color:rgb(227,36,0)"><b>_ !</b></span><b> <span class="" style="white-space:pre">                </span>0xFFFFFF</b></p></div></div><div><b><br></b></div><div>... no syntax here different from the existing except the addition " <span style="font-family:Arial;font-size:13px;color:rgb(227,36,0)"><b>.Red !</b></span><span style="font-size:13px;font-family:Arial"> </span>". As for the exclamation... Swift already uses an exclamation for a billion other things, which is unfortunate. But the same can be said of "?" and that's already used in a "switch" without causing confusion. </div><div><span style="font-size:13px"><br></span></div><div><p style="font-size:13px;margin:0px;line-height:normal;font-family:Arial">> To point 1: I agree it needs a new name, I came up with the “demux expression” </p><p style="font-size:13px;margin:0px;line-height:normal;font-family:Arial">> but maybe there is a better name.<br></p></div><div><span style="font-size:13px"><br></span></div><div>Has anyone suggested "multiary expression" yet? Seems in keeping with "ternary"<br></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px"><br></span></div><div><br></div></div>