<div dir="ltr">> <span style="font-size:13px">multiary is not a natural and easy expression to pronounce.</span><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">I'd be fine with "match expression". Also fine with "</span><span style="font-size:13px">multary</span><span style="font-size:13px">" (no "i"), which is apparently a common alternative to "</span><span style="font-size:13px">multiary.</span>" </div><div><br></div><div>If we use the "colon as separator" version of this proposal, which uses the existing syntax for a ternary, I'd prefer we just called it a "ternary" or a "[something] ternary". Granted with 3+ terms, it's a misnomer, but it's not hard to imagine someone saying "Oh, when you write a Ternary in Swift, you can add conditions to it." I'm quite sure "ternary" is the first thing you would Google, if you came across the kind of expression we're proposing.</div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 6, 2016 at 7:39 PM, Craig Cruden <span dir="ltr"><<a href="mailto:ccruden@novafore.com" target="_blank">ccruden@novafore.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">multiary is not a natural and easy expression to pronounce. <div><br></div><div>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><br></div><div>regardless of syntax - maybe just call it a “match expression”. </div><div><br></div><div><br><div><blockquote type="cite"><div><div class="h5"><div>On 2016-01-07, at 10:06:46, Charles Constant via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr"><div><div><div 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></div></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><div style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;color:rgb(96,96,96)"><b><span style="white-space:pre-wrap">        </span>let val = color ? </b></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;color:rgb(96,96,96)"><b><span style="white-space:pre-wrap">                </span></b><span style="color:rgb(227,36,0)"><b>.Red !</b></span><b> <span style="white-space:pre-wrap">        </span>0xFF0000 : </b></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;color:rgb(96,96,96)"><b><span style="white-space:pre-wrap">                </span></b><span style="color:rgb(227,36,0)"><b>.Green !</b></span><b> <span style="white-space:pre-wrap">        </span>0x00FF00 : </b></div><p style="font-size:13px;margin:0px;line-height:normal;font-family:Arial">
</p><div style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;color:rgb(96,96,96)"><b><span style="white-space:pre-wrap">                </span></b><span style="color:rgb(227,36,0)"><b>_ !</b></span><b> <span style="white-space:pre-wrap">                </span>0xFFFFFF</b></div></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><div 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” </div><div style="font-size:13px;margin:0px;line-height:normal;font-family:Arial">> but maybe there is a better name.<br></div></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>
</div></div><span class=""><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="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">
_______________________________________________<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" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></span></div></blockquote></div><br></div></div></blockquote></div><br></div>