<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=""><div class="">Thanks, great feedback!</div><div class=""><br class=""></div>Good point about the floats, that is definitely a hole in my proposal! I will update it with that.<div class=""><br class=""></div><div class="">To the list form being confusing, I would definitely like to know if others agree that having the two forms is confusing. The list form would be zero based. I would definitely drop it from the proposal if it would lead to it being declined but I think it is nice because it is concise and serves a valuable purpose of choosing among many choices without having to write out each case.&nbsp;</div><div class=""><br class=""></div><div class="">The alternate form, &nbsp;in alternatives considered, a variant of Vestor Godfied’s suggestion, is:</div><div class=""><br class=""></div><div class=""><font face="Monaco" class="">if (x==y : true, false)</font></div><div class=""><font face="Monaco" class="">switch (control : .North:”N”, .South:”S”, .East:”E”, .West:”W”, default:” “)&nbsp;</font></div><div class=""><font face="Monaco" class="">select (control : “A”, “B”, “C”, default:”D”)&nbsp;</font></div><div class=""><br class=""></div><div class="">may be preferred if others agree that it is confusing to have the list form and the case form together. Since Swift leaves parenthesis available around if and switch statements, the parenthesis colon sequence could be used to distinguish the statement and expression form. One thing I really don’t like about it is, that Swift finally solved the problem people running the space up against the &nbsp;parenthesis, something that had bothered me for some time, this would make the practice ingrained if(control : true, false) would become the norm. I suppose in this case it would make sense though.&nbsp;</div><div class=""><br class=""></div><div class="">Or if making it even more explicit we could combine the forms.&nbsp;</div><div class=""><br class=""></div><div class=""><div class=""><font face="Monaco" class="">if?&nbsp;</font><span style="font-family: Monaco;" class="">(x==y : true, false)</span></div><div class=""><font face="Monaco" class="">switch? (control : .North:”N”, .South:”S”, .East:”E”, .West:”W”, default:” “)&nbsp;</font></div><div class=""><font face="Monaco" class="">select? (control : “A”, “B”, “C”, default:”D”)&nbsp;</font></div></div><div class=""><font face="Monaco" class=""><br class=""></font></div><div class="">I expect that that may be more controversial though. As it then steps into the optionals area.&nbsp;</div><div class=""><br class=""></div><div class="">With both these options we lose some conciseness. So I still prefer the form in the proposal.&nbsp;</div><div class=""><br class=""></div><div class="">- Paul</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On Dec 19, 2015, at 2:43 AM, Conrad Kutsch 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=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey, I really like the new proposal, gets a +1from me! Especially the case part makes it good to use. I would just leave out the Integer part because it can be confusing and misleading. Do you start counting at 1? Or at 0? MinInt? It’s just super error-prone if you don’t write the number before it.<div class=""><br class=""></div><div class=""><pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal; color: rgb(51, 51, 51); widows: 1; background-color: rgb(247, 247, 247);" class="">?(charNum <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">:</span> 0: <span class="pl-s" style="box-sizing: border-box; color: rgb(24, 54, 145);"><span class="pl-pds" style="box-sizing: border-box;">"</span>A<span class="pl-pds" style="box-sizing: border-box;">"</span></span>, 1: <span class="pl-s" style="box-sizing: border-box; color: rgb(24, 54, 145);"><span class="pl-pds" style="box-sizing: border-box;">"</span>B<span class="pl-pds" style="box-sizing: border-box;">”</span></span>, ...</pre><div class="">might be OK as it would get rid of the many case statements but then again, is this only working for Int or also for float?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 19 Dec 2015, at 01:56, Paul Ossenbruggen 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 class="">Thanks for your support! <br class=""><br class="">I think parenthesis are preferred because braces are for bracketing lists of statements. Statements may or may not return values. <br class=""><br class="">Having the conditional on the inside of the parens helps to show the begging of the demux operator rather than a floating conditional which is a common complaint with the ternary operator. <br class=""><br class=""><blockquote type="cite" class="">On Dec 18, 2015, at 3:46 PM, Charles Constant &lt;<a href="mailto:charles@charlesism.com" class="">charles@charlesism.com</a>&gt; wrote:<br class=""><br class="">+1 <br class=""><br class="">I'd be very happy with your new proposal too. I still prefer sticking the value we're using as a key outside of the parens, but it's a minor quibble. Also I can't figure out if parens or curly braces are more appropriate. Does it make more sense for the expression to look like a tuple or a closure? I'm not sure.<br class=""><br class="">Anyhow, I'm good with your new proposal.<br class=""><br class=""></blockquote><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></blockquote></div><br class=""></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=emrIhnP1hIf76Foxxv4NNJQX-2FWhcznESwKBSwD1MEwyRAHK3FAn92YiJEPDQUD8iRVel8Yc9DI5UoUd76Hae9a0sImBhWirUXwkj6kAV4LyeUd6Vz9NU6YLA4qxFnkX9iuFPhXciMBXdaSwda5r87-2FUdWOpUbJTHkXPEcrkqMYlqw41wLN6Z0wWzsuDNOKGTMxKCwvPhWQzW1gcShXaE2OY5LIGU4qhWOARKzJll77U-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="">
</div>
_______________________________________________<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>