> On Mar 9, 2017, at 5:59 AM, Matthew Johnson via swift-evolution 
> <[email protected]> wrote:
> 
> I have argued repeatedly that enum cases play two distinct roles (and 
> sometimes a third in the future).  We need to embrace all of these roles.  
> This proposal primarily normalizes the role of case-as-factory-method.  
> 
> Pattern matching is a second role enum cases play.  We already have syntax 
> for patterns that match based on type.  I see no reason we should introduce 
> new matching syntax to disambiguate overloaded cases.  The existing patterns 
> work well for this purpose.  Matching should be considered a role played by 
> enum cases that is completely orthogonal to their role as a factory method.

Matching and construction are closely related and designed to mimic each other. 
They aren't completely orthogonal.

-Joe

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to