<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="">I just realized “cases” probably is not needed - if it see’s a comma after case but before “:” then it is the concise form. <div class=""><br class=""></div><div class="">If the switch / case can do that , the partial function case should be able to do the same thing.</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 2016-01-11, at 13:23:19, Craig Cruden <<a href="mailto:ccruden@novafore.com" class="">ccruden@novafore.com</a>> 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=""><div class="">I have thought about it a bit more and I think this would cover all the cases that interest me (in addition to others needs for a little more conciseness on the most simple case). </div><div class=""><br class=""></div><div class="">I also think we need to be clear that the “case” (or cases) and “default” are is really just a partial function which in it’s entirety is really just a complete function for used wherever a complete function (exhaustive) can be passed (e.g. reduce, filter, etc.) - otherwise they might get confused on why we are adding it to “map”. </div><div class=""><br class=""></div><div class="">The optional where clause should also be part of the case clause as part of the proposal. </div><div class=""><br class=""></div><div class="">There would be no need for statement based “fallthrough”.</div><div class=""><br class=""></div><div class="">You mentioned your proposal…. have you drafted a formal proposal draft?</div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 2016-01-10, at 12:41:03, Paul Ossenbruggen via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">I agree that it would be really useful to keep things concise. I am going to suggest again an idea I had in the past, it is also in my proposal, which might work well for this problem. This might address the verbosity of the “case” and at the same time make it obvious we are dealing with a switch expression. So both would be valid: <div class=""><br class=""></div><div class=""><div class=""><div dir="ltr" class=""><div class="" style="word-wrap: break-word;"><div dir="ltr" class=""><div class="" style="word-wrap: break-word;"><div dir="ltr" class=""><div class="" style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;"><b class=""><div dir="ltr" class="" style="font-family: Helvetica; font-size: 12px; font-weight: normal;"><div class="" style="word-wrap: break-word;"><div dir="ltr" class=""><div class="" style="word-wrap: break-word;"><div dir="ltr" class=""><b class="" style="font-family: Arial; font-size: 13px;"><b class=""><span class="" style="color: rgb(96, 96, 96); white-space: pre-wrap;">        </span><font color="#006d8f" class="">let</font></b><b class="" style="color: rgb(96, 96, 96);"> num = color.</b><font color="#008cb4" class="">map </font>{</b></div></div></div></div></div></b></div></div></div></div></div></div></div></div></div></blockquote><blockquote type="cite" class=""><b class="" style="font-family: Arial; font-size: 13px;"><b class="" style="color: rgb(96, 96, 96);"><span class="" style="white-space: pre-wrap;">        </span></b><b class=""><span class="" style="white-space: pre-wrap;"><font color="#606060" class="">        </font><font color="#006d8f" class="">cases</font><font color="#606060" class=""> </font></span></b><b class=""><font color="#4f7a28" class="">.Red:</font></b><b class="" style="color: rgb(227, 36, 0);"> </b><b class="" style="color: rgb(96, 96, 96);">100,</b><b class="" style="color: rgb(96, 96, 96);"> </b></b><br class=""><b class="" style="font-family: Arial; font-size: 13px;"><b class="" style="color: rgb(96, 96, 96);"><span class="" style="white-space: pre-wrap;">        </span></b><b class=""><span class="" style="white-space: pre-wrap;"><font color="#606060" class="">        <span class="Apple-tab-span" style="white-space: pre;">        </span> </font><font color="#4f7a28" class="">.</font></span></b><b class=""><font color="#4f7a28" class="">Green: </font></b><span class=""> </span><b class="" style="color: rgb(96, 96, 96);">200</b><b class=""><font color="#e32400" class="">,</font></b><b class="" style="color: rgb(96, 96, 96);"> </b></b><br class=""><b class="" style="font-family: Arial; font-size: 13px;"><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 class="Apple-tab-span" style="white-space: pre;">        </span> </span></b><b class=""><font color="#4f7a28" class="">.Blue</font><font color="#e32400" class="">: </font></b><b class="" style="color: rgb(96, 96, 96);">300</b></b><br class=""><b class="" style="font-family: Arial; font-size: 13px;"><b class="" style="color: rgb(96, 96, 96);"><span class="" style="white-space: pre-wrap;">        </span></b><b class=""><span class="" style="white-space: pre-wrap;"><font color="#606060" class="">        </font><font color="#006d8f" class="">default</font></span></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></b><br class=""><b class="" style="font-family: Arial; font-size: 13px;"><span class="" style="color: rgb(227, 36, 0); white-space: pre-wrap;">        </span>}</b><br class=""><b class="" style="font-family: Arial; font-size: 13px;"><b class=""><span class="" style="color: rgb(96, 96, 96); white-space: pre-wrap;">        </span><font color="#006d8f" class="">let</font></b><b class="" style="color: rgb(96, 96, 96);"> num = color.</b><b class=""><font color="#008cb4" class="">map </font>{</b></b><br class=""><b class="" style="font-family: Arial; font-size: 13px;"><b class="" style="color: rgb(96, 96, 96);"><span class="" style="white-space: pre-wrap;">        </span></b><b class=""><span class="" style="white-space: pre-wrap;"><font color="#606060" class="">        </font><font color="#006d8f" class="">case</font><font color="#606060" class=""> </font></span></b><b class=""><font color="#4f7a28" class="">.Red:</font></b><b class="" style="color: rgb(227, 36, 0);"> </b><b class="" style="color: rgb(96, 96, 96);">100</b></b><br class=""><b class="" style="font-family: Arial; font-size: 13px;"><b class="" style="color: rgb(96, 96, 96);"><span class="" style="white-space: pre-wrap;">        </span></b><b class=""><span class="" style="white-space: pre-wrap;"><font color="#606060" class="">        </font><font class="" color="#006d8f">case </font><font color="#606060" class=""> </font><font color="#4f7a28" class="">.</font></span></b><b class=""><font color="#4f7a28" class="">Green: </font></b><span class="" style="font-family: Helvetica;"> </span><b class="" style="color: rgb(96, 96, 96);">200</b><b class="" style="color: rgb(96, 96, 96);"> </b></b><br class=""><b class="" style="font-family: Arial; font-size: 13px;"><b class="" style="color: rgb(96, 96, 96);"><span class="" style="white-space: pre-wrap;">        </span></b><b class=""><span class="" style="white-space: pre-wrap;"><font color="#606060" class="">        </font><font color="#006d8f" class="">case</font><font color="#606060" class=""> </font></span></b><b class=""><font color="#4f7a28" class="">.Blue</font><font color="#e32400" class="">: </font></b><b class="" style="color: rgb(96, 96, 96);">300</b></b><br class=""><b class="" style="font-family: Arial; font-size: 13px;"><b class="" style="color: rgb(96, 96, 96);"><span class="" style="white-space: pre-wrap;">        </span></b><b class=""><span class="" style="white-space: pre-wrap;"><font color="#606060" class="">        </font><font color="#006d8f" class="">default</font></span></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></b><br class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><div dir="ltr" class=""><div class="" style="word-wrap: break-word;"><div dir="ltr" class=""><div class="" style="word-wrap: break-word;"><div dir="ltr" class=""><div class="" style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;"><b class=""><span class="" style="color: rgb(227, 36, 0); white-space: pre-wrap;">        </span>}</b></div><div class=""><b class=""><br class=""></b></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></body></html>