<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>+1 for ".values" instead of just ".count". Really handy feature that Java has. In Java it returns a set not an array which is great for representing status. In C you would use a bit field, but an enum set is better. <br><br>Sent from my iPad</div><div><br>On 21 Dec 2015, at 7:57 PM, Charles Constant via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">If you change your proposal to focus on ".values" instead of ".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><div class="gmail_quote">On Mon, Dec 21, 2015 at 12:46 AM, Brent Royal-Gordon via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> I’ve put a proposal up on GitHub to add a cases ‘count’ functionality to Enums for the Swift language<br>
> <a href="https://gist.github.com/andyyhope/2fc5b6bee8ee1346f688" rel="noreferrer" target="_blank">https://gist.github.com/andyyhope/2fc5b6bee8ee1346f688</a><br>
<br>
</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>
<br>
That approach has been discussed before, but not formally proposed.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Brent Royal-Gordon<br>
Architechies<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</font></span></blockquote></div><br></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=Vm9j-2B2K6zLqxUFTO82XA8HV2TThDz5lA3-2F-2Fpeujw7DQEm9-2FA8Blh-2B8ye6cd4f5wcmM-2ByPRQd-2FqpDzVIZi07HpeupfvV1zGd-2BYr9-2FjC5-2FQHy5wknusscCKuCislCkKnvcFrJ3wJHW06PQduNieuRbYmpgwpnPWRd8RQMaSMpZ11cvbCdeX18lBvwFSf-2FltbvxLxFXqai8houooM-2F6nh-2FvhJITY4no1j3FLn8lP-2BWQ42o-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;">
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>