<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 have noticed holes in the pattern matching….. &nbsp;I can figure out a way to pattern match on an array of “Any” &nbsp;i.e. [.Some(1), nil, 5, “text”] and pull out each into a separate case.<div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 2016-01-10, at 13:09:56, Paul Ossenbruggen &lt;<a href="mailto:possen@gmail.com" class="">possen@gmail.com</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="">Yep good point, should have double checked it. Where is my compiler? :-). Here is the corrected version:<div class=""><br class=""><div 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);">&nbsp;num =&nbsp;color.</b><font color="#008cb4" class="">map&nbsp;</font>{</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="">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);">&nbsp;</b><b class="" style="color: rgb(96, 96, 96);">100,</b><b class="" style="color: rgb(96, 96, 96);">&nbsp;</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:&nbsp;</font></b><span class="">&nbsp;</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);">&nbsp;</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="">:&nbsp;</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);">:&nbsp;</b><b class="" style="color: rgb(96, 96, 96);">-1</b><b class="" style="color: rgb(227, 36, 0);">&nbsp;</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);">&nbsp;num =&nbsp;color.</b><b class=""><font color="#008cb4" class="">map&nbsp;</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);">&nbsp;</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:&nbsp;</font></b><span class="" style="font-family: Helvetica;">&nbsp;</span><b class="" style="color: rgb(96, 96, 96);">200</b><b class="" style="color: rgb(96, 96, 96);">&nbsp;</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="">:&nbsp;</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);">:&nbsp;</b><b class="" style="color: rgb(96, 96, 96);">-1</b><b class="" style="color: rgb(227, 36, 0);">&nbsp;</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=""><div dir="ltr" class="" style="font-family: Helvetica; font-size: 12px;"><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></div></div></div></div></b></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><b class=""></b><div class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 9, 2016, at 10:00 PM, Craig Cruden &lt;<a href="mailto:ccruden@novafore.com" class="">ccruden@novafore.com</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="">Also I don’t think it would be “case:” just “case &lt;pattern&gt; where &lt;expression&gt;:” or “cases .Red: …, .Green: …”<div class=""><br class=""></div><div class=""><br class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On 2016-01-10, at 12:56:19, Craig Cruden &lt;<a href="mailto:ccruden@novafore.com" class="">ccruden@novafore.com</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="">The separation comma would not be applicable to “case: “ since what follows is a block of code (and “,” is not used in code that I know of)….. up until the next “case:”/“default:" or “}" — the last line of the code would evaluate to what is being mapped to.<div class=""><br class=""></div><div class=""><br class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 2016-01-10, at 12:42:14, 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=""><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="">Sorry meant this to say "Craig and Thorsten” &nbsp;</span><div class="" 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;"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 9, 2016, at 9:41 PM, Paul Ossenbruggen &lt;<a href="mailto:possen@gmail.com" class="">possen@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">Hi Charles,</div><div class=""><br class=""></div>Yep, someone needs to build a bike shed otherwise the bike gets all wet, but what color should it be? :-)&nbsp;<div class=""><br class=""></div><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:&nbsp;<div class=""><br class=""></div><div class=""><b class="" style="font-size: 13px; font-family: Arial;"><span class="" style="color: rgb(96, 96, 96); white-space: pre-wrap;">        </span><font color="#006d8f" class="">let</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;num =&nbsp;color.</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#008cb4" class="">map&nbsp;</font>{</b><br class=""><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-size: 13px; font-family: Arial;"><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="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">.Red:</font></b><b class="" style="font-size: 13px; font-family: Arial; color: rgb(227, 36, 0);">&nbsp;</b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">100,</b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;</b><br class=""><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-size: 13px; font-family: Arial;"><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="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">Green:&nbsp;</font></b><span class="" style="font-size: 13px;">&nbsp;</span><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">200</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#e32400" class="">,</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;</b><br class=""><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;"><span class="" style="white-space: pre-wrap;">        <span class="Apple-tab-span" style="white-space: pre;">        </span>      </span></b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">.Blue</font><font color="#e32400" class="">:&nbsp;</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">300</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#e32400" class="">,</font></b><br class=""><b class="" style="font-family: Arial; font-size: 13px; color: rgb(96, 96, 96);"><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="#006d8f" class="">default</font></span></b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">:&nbsp;</b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(96, 96, 96);">-1</b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">&nbsp;</b><br 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></div></div></div></div><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=""><br class=""></b></div><div class="" style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;"><b class=""><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);">&nbsp;num =&nbsp;color.</b><b class=""><font color="#008cb4" class="">map&nbsp;</font>{</b><br class="" style="font-family: Helvetica; font-size: 12px; font-weight: normal;"><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);">&nbsp;</b><b class="" style="color: rgb(96, 96, 96);">100,</b><b class="" style="color: rgb(96, 96, 96);">&nbsp;</b><br class="" style="font-family: Helvetica; font-size: 12px; font-weight: normal;"><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:&nbsp;</font></b><span class="" style="font-family: Helvetica; font-weight: normal;">&nbsp;</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);">&nbsp;</b><br class="" style="font-family: Helvetica; font-size: 12px; font-weight: normal;"><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="">:&nbsp;</font></b><b class="" style="color: rgb(96, 96, 96);">300</b><b class=""><font color="#e32400" class="">,</font></b><br class="" style="font-family: Helvetica; font-size: 12px; font-weight: normal;"><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);">:&nbsp;</b><b class="" style="color: rgb(96, 96, 96);">-1</b><b class="" style="color: rgb(227, 36, 0);">&nbsp;</b><br class="" style="font-family: Helvetica; font-size: 12px; font-weight: normal;"><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=""><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="" style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;"><b class=""><br class=""></b></div></div></div></div></div></div></b></div></div></div></div></div></div></div><div class="">So this is good in that we can avoid duplicating the word “case” which makes it much more concise. Because expressions don’t need the separating abilities of the word “case" between each group of statements, as there can only be one expression after each label. We list the matching cases, &nbsp;the if and when we need the default, we list that. This is both familiar and close enough to the existing “case". And it allows you to also use “case” for each one if you prefer. The other advantage is that we can key off first “case or cases”, as Chris mentioned, and it stands out as a switch expression and can not be confused with a dictionary.&nbsp;</div><div class=""><div class=""><br class=""></div><div class="">So on the single line version:</div><div class=""><br class=""></div><div class=""><b class="" style="font-size: 13px; font-family: Arial;"><span class="" style="color: rgb(96, 96, 96); white-space: pre-wrap;">        </span><font color="#006d8f" class="">let</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;num =&nbsp;color.</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#008cb4" class="">map&nbsp;</font>{<font color="#606060" class="">&nbsp;</font></b><b class="" style="font-size: 13px; font-family: Arial;"><span class="" style="white-space: pre-wrap;"><font color="#006d8f" class="">cases</font><font color="#606060" class="">: </font></span></b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">.Red:</font></b><b class="" style="font-size: 13px; font-family: Arial; color: rgb(227, 36, 0);">&nbsp;</b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">100,</b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;</b><span class="">&nbsp;</span><b class="" style="font-size: 13px; font-family: Arial;"><span class="" style="white-space: pre-wrap;"><font color="#4f7a28" class="">.</font></span></b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">Green:&nbsp;</font></b><span class="" style="font-size: 13px;">&nbsp;</span><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">200</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#e32400" class="">,</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">.Blue</font><font color="#e32400" class="">:&nbsp;</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">300</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#e32400" class="">&nbsp;</font></b><b class="" style="font-family: Arial; font-size: 13px;"><span class="" style="white-space: pre-wrap;"><font color="#006d8f" class="">default</font></span></b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">:&nbsp;</b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(96, 96, 96);">-1</b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">&nbsp;</b><b class="" style="font-family: Arial; font-size: 13px;">}</b><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></div></div></div></div></div><div class=""><br class=""></div><div class="">It looks pretty decent, it is pretty concise, there is no duplication, everyone should know what it means, the case part and the default part stand out pretty nicely. It would also make a hybrid line setup pretty easy as well:</div><div class=""><br class=""></div><div class=""><b class="" style="font-size: 13px; font-family: Arial;"><span class="" style="color: rgb(96, 96, 96); white-space: pre-wrap;">        </span><font color="#006d8f" class="">let</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;num =&nbsp;color.</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#008cb4" class="">map&nbsp;</font>{<font color="#606060" class="">&nbsp;</font></b></div><div class=""><b class="" style="font-size: 13px; font-family: Arial;"><span class="" style="white-space: pre-wrap;"><font color="#006d8f" class=""><span class="Apple-tab-span" style="white-space: pre;">                </span>cases</font><font color="#606060" class="">: </font></span></b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">.Red:</font></b><b class="" style="font-size: 13px; font-family: Arial; color: rgb(227, 36, 0);">&nbsp;</b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">100,</b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;</b><span class="">&nbsp;</span><b class="" style="font-size: 13px; font-family: Arial;"><span class="" style="white-space: pre-wrap;"><font color="#4f7a28" class="">.</font></span></b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">Green:&nbsp;</font></b><span class="" style="font-size: 13px;">&nbsp;</span><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">200</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#e32400" class="">,</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">.Blue</font><font color="#e32400" class="">:&nbsp;</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">300</b><span class=""><font color="#e32400" class="" style="font-family: Arial; font-size: 13px; font-weight: bold;">,</font></span></div><div class=""><b class="" style="font-family: Arial; font-size: 13px;"><span class="" style="white-space: pre-wrap;"><font color="#006d8f" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>        default</font></span></b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">:&nbsp;</b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(96, 96, 96);">-1</b><b class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">&nbsp;</b></div><div class=""><b class="" style="font-family: Arial; font-size: 13px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>}</b><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></div></div></div></div></div></div><div class=""><br class=""></div><div class="">This combined with the case syntax for code blocks from Scala, and map that Charles and Thorsten, have been talking about seems like a pretty decent idea to me.</div><div class=""><br class=""></div><div class="">- Paul</div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jan 9, 2016, at 5:58 PM, Charles Constant &lt;<a href="mailto:charles@charlesism.com" class="">charles@charlesism.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;"><span class="" style="white-space: pre-wrap;">        </span>let&nbsp;num =&nbsp;color.</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#008cb4" class="">map&nbsp;</font>{</b><br class="" style="font-size: 13px;"><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">.Red:</font></b><b class="" style="font-size: 13px; font-family: Arial; color: rgb(227, 36, 0);">&nbsp;</b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">100,</b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;</b><br class="" style="font-size: 13px;"><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-size: 13px; font-family: Arial;"><span class="" style="white-space: pre-wrap;"><font color="#606060" class="">        </font><font color="#4f7a28" class="">.</font></span></b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">Green:&nbsp;</font></b><span class="" style="font-size: 13px;">&nbsp;</span><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">200</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#e32400" class="">,</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">&nbsp;</b><br class="" style="font-size: 13px;"><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;"><span class="" style="white-space: pre-wrap;">        </span></b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#4f7a28" class="">.Blue</font><font color="#e32400" class="">:&nbsp;</font></b><b class="" style="font-size: 13px; color: rgb(96, 96, 96); font-family: Arial;">300</b><b class="" style="font-size: 13px; font-family: Arial;"><font color="#e32400" class="">,</font></b><br class="" style="font-size: 13px;"><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="" 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="">_</font></b><b class="" style="color: rgb(227, 36, 0);">&nbsp;:&nbsp;</b><b class="" style="color: rgb(96, 96, 96);">-1</b><b class="" style="color: rgb(227, 36, 0);">&nbsp;</b></div><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="" style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;"><b class=""><br class=""></b></div><div class="" style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;"><b class=""><br class=""></b></div><div class="" style="margin: 0px; line-height: normal;">Looks like I forgot to mention what my previous message regards: I mean that if we go with "map", I prefer the version that doesn't require "case" be written.<br class=""></div><div class="" style="font-size: 13px; margin: 0px; line-height: normal; font-family: Arial;"><span class="" style="font-family: arial, sans-serif;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal;">I also realize whether we're verbose&nbsp;enough depends on how commonly people use this type of expression. If it is accepted, but unpopular, then I'd concede "verbose" makes more sense.&nbsp;</div><div class="" style="margin: 0px; line-height: normal;"><br class=""></div><div class="" style="margin: 0px; line-height: normal;">Anyways, I'll try to lurk for a while now, instead of posting, as I'm veering toward the bike-shed :)</div><div class="" style="margin: 0px; line-height: normal;"><br class=""></div></div></div><div class="gmail_extra"><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></div></div></div></blockquote></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=CGU22LnxbYa2EM3wKvzuC6syQDwKa0tMs5IyT5gL1wI14bu6jTWe-2B0KEJ1WJk4banRRElUqPtRwTG0z5gNAEKTRstloFSUDXeuT3OJjGb4rRLcqQcTIlrq2sUdCS7Jh7Eq8DOuFjrWCXqxzamA2445s1aEjILA9zIrh52ApfUiNoadM0cFjn4eFSCLqC8Vy1ymFRKK-2BqMbMv8qtvtfOT4fnHkHJJ91Ti4WyLscwKMmo-3D" alt="" width="1" height="1" border="0" 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; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" 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=""><span class="Apple-converted-space">&nbsp;</span></span><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="">_______________________________________________</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=""><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="">swift-evolution mailing list</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=""><a href="mailto:swift-evolution@swift.org" 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="">swift-evolution@swift.org</a><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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" 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="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></div></div></div></div></blockquote></div><br class=""></div></body></html>