<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="">multiary is not a natural and easy expression to pronounce. &nbsp;<div class=""><br class=""></div><div class="">ternary was likely used originally because they could not think of something better - but at least it is easy on the tongue…. [composed of 3 parts]</div><div class=""><br class=""></div><div class="">regardless of syntax - maybe just call it a “match expression”. &nbsp;</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 2016-01-07, at 10:06:46, Charles Constant via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;" class=""><span style="font-family:arial,sans-serif;font-size:small" class="">&gt;&nbsp;</span><span style="font-family:arial,sans-serif" class="">I see what you are trying to do, because of the colon being both used for switch cases and&nbsp;</span><br class=""></div></div></div><div class=""><span style="font-size:13px" class="">&gt; separators for the ternary and so there needs to be a new character for each case. &nbsp;</span></div><div class=""><span style="font-size:13px" class="">&gt; I am not sure that putting colons between each case is really necessary though.</span></div><div class=""><span style="font-size:13px" class=""><br class=""></span></div><div class="">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.&nbsp;</div><div class=""><br class=""></div><div class="">This is why I like colons (this won't make sense unless your email has rich text to show the colors):&nbsp;</div><div class=""><br class=""></div><div class=""><div class=""><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span class="" style="white-space:pre">        </span>let&nbsp;val&nbsp;=&nbsp;color&nbsp;?&nbsp;</b></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span class="" style="white-space:pre">                </span></b><span style="color:rgb(227,36,0)" class=""><b class="">.Red&nbsp;!</b></span><b class="">&nbsp;<span class="" style="white-space:pre">        </span>0xFF0000&nbsp;:&nbsp;</b></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span class="" style="white-space:pre">                </span></b><span style="color:rgb(227,36,0)" class=""><b class="">.Green&nbsp;!</b></span><b class="">&nbsp;<span class="" style="white-space:pre">        </span>0x00FF00&nbsp;:&nbsp;</b></div><p style="font-size:13px;margin:0px;line-height:normal;font-family:Arial" class="">


</p><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span class="" style="white-space:pre">                </span></b><span style="color:rgb(227,36,0)" class=""><b class="">_&nbsp;!</b></span><b class="">&nbsp;<span class="" style="white-space:pre">                </span>0xFFFFFF</b></div></div></div><div class=""><b class=""><br class=""></b></div><div class="">... no syntax here different from the existing except the addition "&nbsp;<span style="font-family:Arial;font-size:13px;color:rgb(227,36,0)" class=""><b class="">.Red&nbsp;!</b></span><span style="font-size:13px;font-family:Arial" class="">&nbsp;</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.&nbsp;</div><div class=""><span style="font-size:13px" class=""><br class=""></span></div><div class=""><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;" class="">&gt; To point 1: I agree it needs a new name, I came up with the “demux expression”&nbsp;</div><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;" class="">&gt; but maybe there is a better name.<br class=""></div></div><div class=""><span style="font-size:13px" class=""><br class=""></span></div><div class="">Has anyone suggested "multiary expression" yet? Seems in keeping with "ternary"<br class=""></div><div class=""><span style="font-size:13px" class=""><br class=""></span></div><div class=""><span style="font-size:13px" class=""><br class=""></span></div><div class=""><span style="font-size:13px" class=""><br class=""></span></div><div class=""><span style="font-size:13px" class=""><br class=""></span></div><div class=""><span style="font-size:13px" class=""><br class=""></span></div><div class=""><br class=""></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=CGU22LnxbYa2EM3wKvzuC6syQDwKa0tMs5IyT5gL1wIBejYBHMX-2Fx1C7ur-2BfKeggnqnWye-2FG8xs6UKQb2EI0s4vEk12dW74zk76p1LFGBtJ2EeA2MbrTH-2FCbPMwWsDif2ir7XBbIUMANy1j2LNAd8UNNgo79-2FAAHVSa6rLUaGQKSRS0HppEaswkSuhAP0RjDPgp6DSxueiQX4JnyojyzqqigVjwzeLmLSl94R3HjnBY-3D" alt="" width="1" height="1" border="0" style="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;" class="">
_______________________________________________<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=""></div></body></html>