<div dir="ltr">Sounds like the team/community has already shown that similarity with C isn&#39;t a priority that overrides clarity/simplicity in the language. Thus, +1<div class="gmail_extra">
<br><div class="gmail_quote">On Wed, Dec 9, 2015 at 3:06 PM, Chris Lattner via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><br><div><blockquote type="cite"><div>On Dec 9, 2015, at 3:01 PM, Mustafa Yusuf via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><div><br></div><div>Hello all. In switch statements in swift if all the possible cases aren&#39;t covered we have to supply a default case.<br></div><div><br></div><div>    let number = 10<br></div><div><br></div><div>    switch number {<br></div><div>    case 10: print(&quot;yay&quot;)<br></div><div>    case 12: print(&quot;close&quot;)<br></div><div>    default: print(&quot;try again&quot;)</div><div>    }<br></div><div><br></div><div>My proposal is replace it with the &quot;case _:&quot;.<br></div><div><br></div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">    let number = 10<br></div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">    switch number {<br></div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">    case 10: print(&quot;yay&quot;)<br></div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">    case 12: print(&quot;close&quot;)<br></div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">    case _: print(&quot;try again&quot;)<br></div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">    }<br></div><div><br></div><div>Since underscore in swift means &quot;whatever I don&#39;t care&quot; it suits here better than &quot;default&quot;. Correct me If I am wrong but this is the only use for &quot;default&quot; keyword in swift I guess. So we can completely remove &quot;default&quot; keyword from the language.<br></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=RC5Cq0zAxCHc1sM9Uy3-2BojrrUAw-2F96zH69NULNHPvCslvdAWVxFPatYqjoDiRb7Q3EgLqm6kAtN3Y8PJd96JZJBEX-2BGOB-2BO1RSgbeUddRPfnNY4iqt4BDptltY2IW1vBi9If3WzLLwBq7R8NbfcAKe20DVwEXtqhCJ6oNJCh0vv41VQgcPrysET-2FQbUs-2Fy7-2F3T3oOaH9LE8SrdRwboiyYlwtWHPLhTLqL-2FahDRrJyPs-3D" alt="" width="1" height="1" border="0" style="min-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">
</div></div></blockquote><br></div></div></div><div>FWIW, this is already supported.  We *also* support default for clarity of code / because it reads better, and for similarly with the (extended) C family of languages.</div><div><br></div><div>-Chris</div><br>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=P-2BsYbBZHRBuLDBJaL4DIKDNfkkjpROowTyRAObV11qxNF6r-2FmW9Dz9-2FJokcxzd9sYsFLKPasd32mQiH1sgxyQlqTjrIyXoLwFTzjhcqZ7JkRwJWET3nVojOvFHT0HznZzcEECdKzDR9WgNVfXk8dGNrDYHsH4sVcKqSR22cmYD57sqiYRXqxn9LrSTqJKX0gvkxDU8atYeEgfWhWcTI9fn900Pvtbx6Dx0UOw1QTxO4-3D" alt="" width="1" height="1" border="0" style="min-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">
</div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div></div>