[swift-evolution] [Review] SE-0194: Derived Collection of Enum Cases
svabox at gmail.com
Tue Jan 9 15:12:08 CST 2018
On 09.01.2018 21:43, Kevin Nattinger via swift-evolution wrote:
>> Proposal link:
>> * 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.
FWIW +1 for all Kevin said
>> * 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?
>> * 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
More information about the swift-evolution