[swift-evolution] [Pitch] Enforce argument order for defaulted parameters

Howard Lovatt howard.lovatt at gmail.com
Wed Mar 30 17:00:24 CDT 2016


As William said, so long as you can still omit unused arguments.

On Thursday, 31 March 2016, William Dillon via swift-evolution <
swift-evolution at swift.org> wrote:

> As long as you can still provide an overriding value to only one of the
> defaulted parameters I probably wouldn't miss it.  I would hate to have to
> re-state the default value of all the parameters up to the one I want to
> change, though.
>
> - Will
>
> > On Mar 30, 2016, at 9:59 AM, Joe Groff via swift-evolution <
> swift-evolution at swift.org <javascript:;>> wrote:
> >
> > Many people are surprised when they find out defaulted parameters can be
> reordered, unlike required arguments. This special case adds complexity to
> the language, and runs against our general trend of treating argument
> labels as a significant part of an API's name, and preferring a single way
> of writing API calls. I think it's worth revisiting this design choice—is
> the special case worth the complexity? How many people take advantage of
> default argument reordering?
> >
> > -Joe
> > _______________________________________________
> > swift-evolution mailing list
> > swift-evolution at swift.org <javascript:;>
> > https://lists.swift.org/mailman/listinfo/swift-evolution
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <javascript:;>
> https://lists.swift.org/mailman/listinfo/swift-evolution
>


-- 
-- Howard.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160331/dda4adfe/attachment.html>


More information about the swift-evolution mailing list