[swift-evolution] Require parameter names for ENUM Associated Types?

Steve Prescott steveappledev at gmail.com
Wed Nov 30 12:20:08 CST 2016


Adrian and Karl,

OK, thanks for the constructive feedback.


On Wed, Nov 30, 2016 at 11:45 AM, Karl <razielim at gmail.com> wrote:

>
> > On 30 Nov 2016, at 14:11, Steve Prescott via swift-evolution <
> swift-evolution at swift.org> wrote:
> >
> > As the original poster of this thread, I wanted to re-state the original
> question:
> >
> > Should enums REQUIRE parameter names?
> >
> > Pro:          The syntax would more closely match that for functions,
> which requires names for all parameters (unless you say “_”) vs. the
> current syntax that is sort of C-like.
> > Con:  More verbose
> >
> > With this suggestion, your declaration of a variable that uses an enum
> would resemble calling a function.  e.g.:
> >
> > var myTeam = Team.football (name: “Redskins”, city: “Washington, DC”,
> quarterback: “Kirk Cousins”)
> >
>
> I don’t think they should be required. The payload is actually a tuple,
> and element names are not required for tuples (and not even supported for
> single-element tuples).
>
> Your example is still possible without requiring labels; all that would
> change is that code which works today would suddenly break. Unless I’m
> mistaken, your proposal is about removing functionality and does not add
> anything.
>
> - Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161130/eb1a0f96/attachment.html>


More information about the swift-evolution mailing list