<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 5, 2016, at 10:51 AM, Sean Heber &lt;<a href="mailto:sean@fifthace.com" class="">sean@fifthace.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class="">And maybe allow a special case for boolean where you can leave off the “case true:” part:<br class=""><br class="">let x = something ? thing() else: otherThing()<br class=""><br class="">And then you could more or less replace ternary with this new construct that can do even more while looking very similar and still being pretty terse and the addition of “else” in there makes the entire expression stand out a bit more than traditional ternary expressions which, I think, addresses one of the complaints there.<br class=""></blockquote><br class="">I do not like this idea. &nbsp;I think a case expression should follow the case statement where a corresponding keyword is used. &nbsp;If you want to make this more like ternary we should just allow `:` without any keyword for the default clause.<br class=""><br class="">Your suggestion that this would replace ternary and require an `else:` instead of `:` is going to be a non-starter. You may want to read the “frequently proposed changes” document as it explains why such a change won’t happen.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I don’t see anything in that document that says that replacing ‘:' with ‘else:' in a ternary is necessarily a nonstarter - the ternary feature would still exist, it would only be *slightly* more verbose. The document says that one that is “better enough” hasn’t been found yet but it doesn’t read to me that it is a declared fact that “better enough” will *never* happen.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></div></blockquote><div><br class=""></div><div>The concise nature of ternary is considered one of its big advantages. &nbsp;I don’t think any alternatives that require 3x more characters are going to be seriously considered. &nbsp;But who knows, I might be wrong.</div><br class=""><blockquote type="cite" class=""><div style="" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">In any case, replacing ternary isn’t really something I care about - but I do want switch-as-expression since I’ve run into that a *lot* in one of my current projects where I adopted enums quite heavily. My suggestion was only that such a construct *could* be massaged to also cover ternary and thus could be considered a single construct that solved two “problems”: changing ternary to stand out slightly more, and getting switch-as-expression at the same time.</span><br class=""></div></blockquote><br class=""></div><div>I agree that a case expression would be a good thing. &nbsp;I think we are more likely to see a proposal for that adopted if it doesn’t include any changes to ternary.</div><br class=""></body></html>