<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></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 Dec 9, 2015, at 3:01 PM, Mustafa Yusuf 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=""><meta content="text/html;charset=UTF-8" http-equiv="Content-Type" class=""><div class=""><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;" class=""><div class=""><br class=""></div><div class="">Hello all. In switch statements in swift if all the possible cases aren't covered we have to supply a default case.<br class=""></div><div class=""><br class=""></div><div class=""> let number = 10<br class=""></div><div class=""><br class=""></div><div class=""> switch number {<br class=""></div><div class=""> case 10: print("yay")<br class=""></div><div class=""> case 12: print("close")<br class=""></div><div class=""> default: print("try again")</div><div class=""> }<br class=""></div><div class=""><br class=""></div><div class="">My proposal is replace it with the "case _:".<br class=""></div><div class=""><br class=""></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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> let number = 10<br class=""></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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> switch number {<br class=""></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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> case 10: print("yay")<br class=""></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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> case 12: print("close")<br class=""></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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> case _: print("try again")<br class=""></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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> }<br class=""></div><div class=""><br class=""></div><div class="">Since underscore in swift means "whatever I don't care" it suits here better than "default". Correct me If I am wrong but this is the only use for "default" keyword in swift I guess. So we can completely remove "default" keyword from the language.<br class=""></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="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;" class="">
</div></div></blockquote><br class=""></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 class=""></div><div>-Chris</div><br class=""></body></html>