<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=""><div class="">Just a couple of thoughts swirling in my brain. </div><div class=""><br class=""></div><div class="">1. Ternary means : composed of three parts …. if we add case functionality, it no longer is a ternary and should be renamed (ex : nil coalescing … was used instead of calling it a ternary optional). Would love to hear thoughts on what names it could have … if the proposal moves forward.</div><div class=""><br class=""></div><div class="">---</div><div class=""><br class=""></div><div class="">I am leaning towards this pattern (someone else introduced), yet I don’t feel it is perfect.</div><div class=""><br class=""></div><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> ? </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">_</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span></div><div class=""><br class=""></div><div class="">2. I have a problem with “_”. I don’t agree with it being the default value. It is currently used to discard or ignore values … using it as a default will add unnecessary confusion that does not align with Swift. Writing out the word default instead of _ is only 6 more characters. Please correct me if I am wrong on this note.</div><div class=""><br class=""></div><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> ? </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> <font color="#9929bd" class="">default</font></span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span></div><div class=""><br class=""></div><div class="">3. Having “?” for the Bool operator and “:” for the cases presents confusion with the current ? : ternary design pattern. This is another potential issue … just not a big of a deal as the “default as _”.</div><div class=""><br class=""></div><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> case </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> <font color="#9929bd" class="">default</font></span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span></div><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> ??? </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> <font color="#9929bd" class="">default</font></span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px;" class="">And some less serious ones.</div></span></div><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"><br class=""></span></div><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">switch let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> case </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> <font color="#9929bd" class="">default</font></span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span></div><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">case let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">??? </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> <font color="#9929bd" class="">default</font></span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span><div class=""><font color="#0061ff" face="Arial" size="2" class=""><br class=""></font><div class=""><div class="">I do believe this functionality is worth adding to Swift core lib. I just want to see it as closely aligned with Swift as possible.</div><div apple-content-edited="true" class="">
<br class="Apple-interchange-newline"><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=""><font color="#8d8d8d" class=""><span class="Apple-converted-space"> </span>Nerd . Designer . Developer</font></span><font color="#464646" class=""><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="">Jo Albright</span></font><br class=""></div></div></div></body></html>