<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="">Does the naming "values" have precedence elsewhere? To me, "cases" is clearer, whereas "rawValues" would make sense if there was an additional, auto-generated static property for enumerations with underlying values.</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; enum Section: Int { case SectionA, Section B }</div><div class="">&nbsp; &nbsp; Section.cases // [.SectionA, .SectionB]</div><div class="">&nbsp; &nbsp; Section.rawValues // [0, 1]</div><div class=""><br class=""></div><div class="">Because "rawValue" already exists, "values" makes things a bit more confusing: are they the cases themselves or are they their underlying values?</div><div class=""><br class=""></div><div class="">Stephen</div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 21, 2015, at 3:57 AM, Charles Constant 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 dir="ltr" class="">If you change your proposal to focus on ".values" instead of&nbsp;".values.count" (which you'd get for free, as you note) I would strongly support it. I don't need ".count" on its own, but ".values" ... well, I have a whole load of enums in my current projects with a ".values" I had to hardcode myself. I would love to get that for free.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Dec 21, 2015 at 12:46 AM, Brent Royal-Gordon via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">&gt; I’ve put a proposal up on GitHub to add a cases ‘count’ functionality to Enums for the Swift language<br class="">
&gt; <a href="https://gist.github.com/andyyhope/2fc5b6bee8ee1346f688" rel="noreferrer" target="_blank" class="">https://gist.github.com/andyyhope/2fc5b6bee8ee1346f688</a><br class="">
<br class="">
</span>I think we'd be much better off having a list of all cases. That would make this feature useful for enums which don't have a raw type, or don't use Int as their raw type, or don't use sequential raw values for their cases.<br class="">
<br class="">
That approach has been discussed before, but not formally proposed.<br class="">
<span class="HOEnZb"><font color="#888888" class=""><br class="">
--<br class="">
Brent Royal-Gordon<br class="">
Architechies<br class="">
<br class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</font></span></blockquote></div><br class=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=5xu02FVv-2BCbxTLHpBsC0RVeXVC5uCln3pUIIeLTlIi2fpX5O6bvHVjfZatptJLbAY-2BwdYFyE1EMaEsPt0i6h9NkDeX6Bbp-2F4ExmQxGAZ4M8T0F9Qd9PQc40bC6qAzhbFMMEQPD5-2Buunl9rRWB9nbwXrMUBvQ-2BV-2By89iWaMA-2BdWqowoyqMRw9W1mITASW3ofGfeMQZXMllkKXiHCE1tjkM-2Fm3Ua-2B93VmspJTyftgNL4M-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="">
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>