[swift-evolution] [Review] SE 0192 - Non-Exhaustive Enums
razielim at gmail.com
Wed Dec 20 07:36:25 CST 2017
> On 19. Dec 2017, at 23:58, Ted Kremenek via swift-evolution <swift-evolution at swift.org> wrote:
> The review of "SE 0192 - Non-Exhaustive Enums" begins now and runs through January 3, 2018.
> The proposal is available here:
> https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md <https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md>
> Reviews are an important part of the Swift evolution process. All review feedback should be sent to the swift-evolution mailing list at:
> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> or, if you would like to keep your feedback private, directly to the review manager.
> When replying, please try to keep the proposal link at the top of the message:
> Proposal link: https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md <https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md>
> Reply text
> Other replies
> What goes into a review of a proposal?
> The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift.
> When reviewing a proposal, here are some questions to consider:
> What is your evaluation of the proposal?
+1, it needs to happen (and ASAP, since it _will_ introduce source-breaking changes one way or the other).
I think non-exhaustive is the correct default. However, does this not mean that, by default, enums will be boxed because the receiver doesn’t know their potential size? That would mean that the best transition path for multi-module Apps would be to make your enums @exhaustive, rather than adding “default” statements (which is unfortunate, because I imagine when this change hits, the way you’ll notice will be complaints about missing “default” statements).
I do have some thoughts about how we could ease the transition (for this and other resilience-related changes), but it’s best to leave that to a separate discussion.
The one thing I’m still not overly fond of is the name - I would like us to keep the set of resilience/optimisation related keywords to a minimum. “exhaustive” for enums feels an awful lot like “fixed_contents” for structs - couldn’t we come up with a single name which could be used for both? I don’t think anybody’s going to want to use “exhaustive” for structs.
> Is the problem being addressed significant enough to warrant a change to Swift?
Definitely. Major part of ABI stability.
> Does this proposal fit well with the feel and direction of Swift?
It does indeed.
> If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
I can’t remember making much use of exhaustive enums before Swift.
> How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
Followed earlier discussions, read the proposal and comments so far. Even gave it a bit of thought, which was refreshing.
> Ted Kremenek
> Review Manager
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution