On Mon, Dec 21, 2015 at 1:42 AM, Andyy Hope via swift-evolution <
swift-evolution@swift.org> wrote:

> Hi Swift Team and Community
>
> I’ve put a proposal up on GitHub to add a cases ‘count’ functionality to
> Enums for the Swift language
> https://gist.github.com/andyyhope/2fc5b6bee8ee1346f688
>
>
> Comments, feedback, scenario appends very much welcomed. Thank you
>

I would discourage adding just a `.count`. I've heard a few people ask for
this over the last year. In almost all cases it is due to people falling
back to the way they dealt with enums in Objective C when in fact there is
usually a better way in Swift.  Adding `.count` would inhibit the discovery
of better ways of doing things.

However, I'm having a hard time arguing against `.cases`. In at least one
place I currently have an `.allCases` computed property on an enum.

--
bart
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to