<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">The proposal is available here:</span></div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><blockquote style="-webkit-print-color-adjust: exact; margin: 15px 0px; border-left-width: 4px; border-left-style: solid; border-left-color: rgb(221, 221, 221); padding: 0px 15px; color: rgb(119, 119, 119); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class=""><div style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md</a></div></blockquote><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">What is your evaluation of the proposal?</p></li></ul></div></div></blockquote><div><br class=""></div>-1</div><div><br class=""></div><div>I would much prefer the solution proposed by Andrew Bennett in another thread which solves all problems very nicely including the testability of future cases by giving them a placeholder name:</div><div><br class=""></div><div>From Andrew’s mail:</div><blockquote type="cite" class=""><div><div style="font-family: HelveticaNeue;" class=""><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-k" style="color: rgb(215, 58, 73); box-sizing: border-box;">public</span><font color="#24292e" class=""> </font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-k" style="color: rgb(215, 58, 73); box-sizing: border-box;">enum</span><font color="#24292e" class=""> </font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-en" style="color: rgb(111, 66, 193); box-sizing: border-box;">HomeworkExcuse</span><font color="#24292e" class=""> {
</font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-k" style="color: rgb(215, 58, 73); box-sizing: border-box;">case</span><font color="#24292e" class=""> </font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-c1" style="box-sizing: border-box;"><font color="#0b5394" class="">eatenByPet</font></span><font color="#24292e" class="">
</font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-k" style="color: rgb(215, 58, 73); box-sizing: border-box;">case</span><font color="#24292e" class=""> </font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-c1" style="box-sizing: border-box;"><font color="#0b5394" class="">thoughtItWasDueNextWeek</font></span><font color="#24292e" class="">
</font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-k" style="color: rgb(215, 58, 73); box-sizing: border-box;">fallback </span><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-k" style="box-sizing: border-box;"><font color="#0b5394" class="">unknown</font></span><font color="#24292e" class=""> </font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-c" style="color: rgb(106, 115, 125); box-sizing: border-box;"><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-c" style="box-sizing: border-box;">//</span> NEW</span><font color="#24292e" class="">
</font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-c" style="box-sizing: border-box; color: rgb(106, 115, 125);"></span><font color="#24292e" class="">}</font></pre></div><div style="font-family: HelveticaNeue;" class=""><br class=""></div><div style="font-family: HelveticaNeue;" class="">Then I believe you would be able to have an exhaustive switch like this:</div><div style="font-family: HelveticaNeue;" class=""><br class=""></div><div style="font-family: HelveticaNeue;" class=""><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-en" style="box-sizing: border-box;"><font color="#d73a49" class="">switch </font></span><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-en" style="color: rgb(111, 66, 193); box-sizing: border-box;">thing</span><font color="#24292e" class=""> {
</font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-k" style="color: rgb(215, 58, 73); box-sizing: border-box;">case</span><font color="#24292e" class=""> </font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-c1" style="box-sizing: border-box;"><font color="#0b5394" class="">eatenByPet: </font><font color="#cc0000" class="">break</font></span><font color="#24292e" class="">
</font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-k" style="color: rgb(215, 58, 73); box-sizing: border-box;">case</span><font color="#24292e" class=""> </font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-c1" style="box-sizing: border-box;"><font color="#0b5394" class="">thoughtItWasDueNextWeek:</font><font color="#cc0000" class=""> break</font></span><font color="#24292e" class="">
</font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-k" style="color: rgb(215, 58, 73); box-sizing: border-box;">case </span><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-k" style="box-sizing: border-box;"><font color="#0b5394" class="">unknown</font><font color="#24292e" class="">: </font><font color="#cc0000" class="">break</font></span><font color="#24292e" class="">
</font><span class="gmail-m_1118565368265080773gmail-m_-1318432576890994713gmail-pl-c" style="box-sizing: border-box; color: rgb(106, 115, 125);"></span><font color="#24292e" class="">}</font></pre></div><div style="font-family: HelveticaNeue;" class=""><br class=""></div><div class="gmail_extra" style="font-family: HelveticaNeue;">Which would <b class="">still allow compile-time errors if new cases are introduced</b>, while providing a concise way to show something is not exhaustible.</div><div class="gmail_extra" style="font-family: HelveticaNeue;"><br class=""></div><div class="gmail_extra" style="font-family: HelveticaNeue;">This would also <b class="">support existing enums with "unknown" equivalent cases</b> would be able to explicitly label those fields as fallback without needing to make large code changes.</div><div class="gmail_extra" style="font-family: HelveticaNeue;"><br class=""></div><div class="gmail_extra" style="font-family: HelveticaNeue;">I see no reason why you shouldn't be able to use ".unknown", which <b class="">should still allow this to be testable</b>.</div></div></blockquote><div><div class=""><br class=""></div><div class="">i.e. Andrew’s idea is to introduce a placeholder case instead of marking the enum as exhaustive/non-exhaustive. This gives the future cases a handle to be switched on and to be tested against. Very elegant.</div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">Is the problem being addressed significant enough to warrant a change to Swift?</p></li></ul></div></div></blockquote>Yes, but the proposed solution is not as good as it should be, neglecting to provide compile-time errors if new cases are introduced.<br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">Does this proposal fit well with the feel and direction of Swift?</p></li></ul></div></div></blockquote>No, due to its shortcomings.<br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</p></li></ul></div></div></blockquote>None, but see Andrew Bennett’s idea above.<br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</p></li></ul></div></div></blockquote>Followed most of the discussion and review threads.</div><div><br class=""></div><div>-Thorsten</div></body></html>