<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 class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><span class="im"><div class="" style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);"><b class="" style="color: rgb(227, 36, 0);"><br class=""></b></div><div class="" style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);"><b class="" style="color: rgb(227, 36, 0);"><br class=""></b></div></span></div></div></div></div><div><blockquote type="cite" class=""><div class="">On Jan 9, 2016, at 4:09 PM, Charles Constant <<a href="mailto:charles@charlesism.com" class="">charles@charlesism.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">More fiddling... any takers for "on"? <div class=""><br class=""></div><div class="">Yes, this is partly a last ditch attempt trying to revive my earlier proposal :) It still irks me that we'd have a switch using the colon two different ways. Also my last suggestion had the order reversed ( i.e.: "val =test" but then "==test val" in the cases ) which is irritating.<div class=""><div class=""><br class=""></div><div class=""><span class="im"><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span style="white-space:pre-wrap" class="">        </span>let str = boo ? </b></div><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class="">"yes" </b><b style="color:rgb(227,36,0)" class="">on true </b><b class="">: </b></div><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class="">"no" </b><b style="color:rgb(227,36,0)" class="">on </b><b style="color:rgb(227,36,0)" class="">false</b></div><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><br class=""></b></div><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span style="white-space:pre-wrap" class="">        </span>let num = color ? </b></div><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class="">100 </b><b style="color:rgb(227,36,0)" class="">on .Red </b><b class="">: </b></div><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class="">200 </b><b style="color:rgb(227,36,0)" class="">on .Green</b><b style="color:rgb(227,36,0)" class=""> </b><b class="">: </b></div><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class="">300 </b><b style="color:rgb(227,36,0)" class="">on .Blue </b><b style="color:rgb(227,36,0)" class=""> </b><b class="">: </b></div><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class=""><span style="white-space:pre-wrap" class="">        </span></b><b class="">-1 </b><b style="color:rgb(227,36,0)" class="">on default </b></div><div style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial; color: rgb(96, 96, 96);" class=""><br class=""></div></span></div></div></div></div></div></blockquote><div><br class=""></div><div><span class=""><span class=""><font class=""><font face="Arial" class="">This does have some nice properties, like more compact than “case", don’t need the word “case" out front and a separator. Having the order the other way though I think would not work. You would need t support long expressions etc, so I don’t think having it reversed would be popular. Perhaps something like this</font></font><br style="font-family: Helvetica; font-size: 12px; font-weight: normal; white-space: normal;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-weight: normal; white-space: normal;" class=""></blockquote><br class=""></span></span><div class=""><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;"><span class="" style="white-space: pre-wrap;">        </span>let num = color ? </b><br class=""><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-family: Arial; font-size: 13px;"><font color="#4f7a28" class="">.Red </font></b><b class="" style="font-family: Arial; font-size: 13px;"><font color="#008cb4" class="">to</font></b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);"> </b><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;">100 </b><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;">: </b><br class=""><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-family: Arial; font-size: 13px;"><span class="" style="white-space: pre-wrap;"><font color="#606060" class="">        </font><font color="#4f7a28" class="">.</font></span></b><b class="" style="font-family: Arial; font-size: 13px;"><font color="#4f7a28" class="">Green</font></b> <font color="#008cb4" class="">to</font> <b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;">200</b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);"> </b><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;">: </b><br class=""><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-family: Arial; font-size: 13px;"><font color="#4f7a28" class="">.Blue</font></b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);"> </b><b class="" style="font-family: Arial; font-size: 13px;"><font color="#008cb4" class="">to</font></b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);"> </b><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;">300</b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);"> </b><b class="" style="color: rgb(96, 96, 96); font-family: Arial; font-size: 13px;">: </b><br class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><span class="im"><div class="" style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;"><b class="" style="color: rgb(96, 96, 96);"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="color: rgb(96, 96, 96);"><span class="" style="white-space: pre-wrap;">        </span></b><b class=""><font color="#4f7a28" class="">default</font></b><b class="" style="color: rgb(227, 36, 0);"> </b><b class=""><font color="#008cb4" class="">to</font></b><b class="" style="color: rgb(227, 36, 0);"> </b><b class="" style="color: rgb(96, 96, 96);">-1</b><b class="" style="color: rgb(227, 36, 0);"> </b></div></span></div></div></div></div></div></div><div><br class=""></div><div>I like some of it but, I still want to put the colons in-between the case labels. This syntax would be seen as too different from something we already have with the “case label: expression” syntax. Maybe seen as “different but not better"</div><div><br class=""></div><div>Meanwhile I have been learning Scala. The unary function, partial functions, and pattern matching stuff looks cool.</div><div><br class=""></div><div>- Paul </div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><span class="im"><div style="margin: 0px; line-height: normal;" class=""><font color="#222222" class=""><br class=""></font></div><div style="margin: 0px; line-height: normal;" class=""><font color="#222222" class="">The more verbose forms will be easier to learn, I suppose, but it's also nice, when you have a long list of things like this, to keep things as json-y as possible. Granted if we use the short version, there's developers who will flame anyone listening for </font><span style="color:rgb(34,34,34)" class="">doubling down on</span><font color="#222222" class=""> the evil ternary.</font><br class=""></div><div style="font-size:13px" class=""><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small" class=""><br class=""></span></div></span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Jan 8, 2016 at 11:18 AM, Chris Lattner <span dir="ltr" class=""><<a href="mailto:clattner@apple.com" target="_blank" class="">clattner@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Jan 7, 2016, at 12:10 AM, Paul Ossenbruggen <<a href="mailto:possen@gmail.com" class="">possen@gmail.com</a>> wrote:<br class="">
> Just a few hopefully quick questions:<br class="">
><br class="">
> Do you have any thoughts on supporting two forms? Like the compact form where case and default are not present, and the more formal switch like form?<br class="">
<br class="">
Adding two forms seems very unlikely to be accepted - even adding one form is unclear :-)<br class="">
<br class="">
> Do you have any specific reasons to not support “where”? Is it just to keep it simple and when we need more complexity use the statement form?<br class="">
<br class="">
I don’t have a strong objection to where, other than trying to keep things simple. It is reasonable to argue that removing “where” makes things more complex by making the expression *different* from the statement though.<br class="">
<span class="HOEnZb"><font color="#888888" class=""><br class="">
-Chris</font></span></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>