[swift-evolution] [Pitch] Make the first parameter in a function declaration follow the same rules as the others

Pierre Monod-Broca pierremonodbroca at gmail.com
Thu Mar 10 06:29:45 CST 2016


Big +1 too.


Pierre

> Le 10 mars 2016 à 11:07, Adrian Kashivskyy via swift-evolution <swift-evolution at swift.org> a écrit :
> 
> Big +1
> 
> 
> Pozdrawiam – Regards,
> Adrian Kashivskyy
> 
>> Wiadomość napisana przez Joe Groff via swift-evolution <swift-evolution at swift.org> w dniu 09.03.2016, o godz. 19:58:
>> 
>> Our accepted naming guidelines have embraced first argument labels for functions and methods. This weakens our justification for making the first parameter declaration in a `func` declaration behave differently from the others, implicitly being unlabeled. It seems pretty clear to me we should make all of the parameter declarations behave uniformly:
>> 
>> func foo(x: Int, y: Int) // Should declare foo(x:y:), instead of foo(_:y:)
>> func foo(_ x: Int, y: Int) // Explicitly declares foo(_:y:)
>> 
>> This would also make `init` and `func` parameters behave consistently, which is nice. There may still be hope for our keyword argument rules to one day be shorter than the Smalltalk spec…
>> 
>> -Joe
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160310/3baafe50/attachment.html>


More information about the swift-evolution mailing list