<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="">Oops. I have wanted this feature and I have created&nbsp;`name` methods for non-String enums numerous times (whether I had to or not, I guess). If there is a formal proposal for this, I could not find it. I am obviously not familiar with the entire proposal but this is a feature that I have wanted almost from the first day I started using Swift.</div><div class=""><br class=""></div><div class="">I would prefer a `name`method for enums and not overload `description`.</div><div class=""><br class=""></div><div class="">A standard way of accessing the unique names of enum values would be compatible with a future variant of `enum` that would allow non-unique&nbsp;rawValue&nbsp;should Swift ever support that feature of C/C++ enums. (hint) It would become requirement for these enums, I think.</div><div class=""><br class=""></div><div class="">Accessing the names of enum values is extremely useful for diagnostics and quick and dirty UI e.g. playgrounds.&nbsp;</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Jun 1, 2016, at 3:07 PM, Paul Cantrell &lt;<a href="mailto:cantrell@pobox.com" class="">cantrell@pobox.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" 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=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 1, 2016, at 2:20 PM, Christopher Kornher 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=""><div style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: 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=""><blockquote type="cite" class=""><div class="">On Jun 1, 2016, at 12:53 PM, Paul Cantrell 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=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">This is the case I was thinking of where the module name comes into play. Drop those enums into a framework, and you’ll get&nbsp;<span class="" style="color: rgb(102, 139, 73); font-family: Menlo; font-size: 11px;">"</span><font color="#668b49" face="Menlo" class=""><span class="" style="font-size: 11px;">landed(MyFramework.CoinSide.heads)"</span></font>. Ugh!</div></div></div></blockquote><div class=""><br class=""></div><div class="">This seems to be more of namespace “import” issue than a problem with enums specifically. Declaring enums within another entity is a useful. I take advantage of qualified naming to make short, possibly non-unique enum names.</div></div></div></blockquote></div><br class=""><div class="">Yes, in _code_ fully qualified names are useful.</div><div class=""><br class=""></div><div class="">This thread is the need for unqualified names in _strings_ — for passing to external systems, logging, etc.</div><div class=""><br class=""></div><div class="">The problematic behavior I was pointing out is that enums get converted to a name-only string when they are at the _top_ level of a data structure, but a fully qualified Module.EnumType.caseName when they're _nested_ inside a collection or another enum. AFAIK, there's no way to override this behavior without manually coding a case statement to map enum values to strings. This proposal would solve that.</div><div class=""><br class=""></div><div class="">Cheers, P</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></blockquote></div><br class=""></body></html>