[swift-evolution] [Proposal] Enums with stored properties
Kevin Nattinger
swift at nattinger.net
Mon Oct 10 13:24:36 CDT 2016
I agree wholeheartedly. An enum case should be a compile-time constant. IMO, “enums” with associated values should properly be a separate entity, called “union” as that’s essentially what they are.
> On Oct 10, 2016, at 10:31 AM, Kenny Leung via swift-evolution <swift-evolution at swift.org> wrote:
>
> This is the way Java enumerations work.
>
> https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html
>
> I think it is a good model, and I think Swift enumerations should also work the same way.
>
> An enumeration is a finite set of things. It’s really inconvenient to have to limit those things to have only a single attribute.
>
> -Kenny
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
More information about the swift-evolution
mailing list