[swift-evolution] [Review] SE-0194: Derived Collection of Enum Cases

Cheyo Jimenez cheyo at masters3d.com
Tue Jan 9 14:01:30 CST 2018



> On Jan 9, 2018, at 10:43 AM, Kevin Nattinger via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> Proposal link:
>> 
>> https://github.com/apple/swift-evolution/blob/master/proposals/0194-derived-collection-of-enum-cases.md
>> 
>> What is your evaluation of the proposal?
> +1 on the general problem, but I have a few comments on the design specifics
> 
> - I'd very much prefer automatic synthesis with enums, 
> - I strongly feel the compiler should auto-generate the implementation in an extension for enums.
> - Should we add `ValueCollection.Index == Int` to the associatedtype so it can always be indexed as in a table? 
>   - At the least, we should ensure the synthesized implementation is int-indexed for tables.
> - I feel we should allow auto-generation of imported c enums in an extension, as just an array of the known cases rather than the magical metadata iterator if necessary. 
> 
+1 for known cases at compile time. 


>> Is the problem being addressed significant enough to warrant a change to Swift?
> Definitely. It's been a gaping hole in the language since the beginning.
> 
>> Does this proposal fit well with the feel and direction of Swift?
> Yes
> 
>> If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
> I prefer Java's automatic allValues(), but this is better than nothing.
> 
>> How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
> Followed at least the start of several threads and read the proposal.
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20180109/606e5518/attachment.html>


More information about the swift-evolution mailing list