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

Are you certain? Last we checked it was about 50/50 between having and
not-having a distinct argument label.

···

on Sun Mar 13 2016, Shawn Erickson <swift-evolution@swift.org> wrote:

On Fri, Mar 11, 2016 at 1:30 PM Dave Abrahams via swift-evolution < > swift-evolution@swift.org> wrote:

Anyone who wants to measure is free to do so: simple regexps and wc
generally work for this purpose.

https://github.com/apple/swift-3-api-guidelines-review/tree/swift-3/Platforms

Not sure if anyone actually got around to this so doing a basic set of
regex (includes class functions and overrides)...

func foo(bar baz:Baz... ---> 10544
func foo(baz:Baz... ---> 526
func foo(_:Baz... ---> 92
func foo() ---> 7392

--
-Dave

The "shorthand" of providing a single name that is used both as an argument label and a parameter name. (Sorry for being unclear about that.) Objective-C has no way to do that, and so there's no incentive to make selector pieces exactly match parameter names.

Jordan

···

On Mar 11, 2016, at 16:01 , Dave Abrahams <dabrahams@apple.com> wrote:

On Mar 11, 2016, at 2:57 PM, Jordan Rose <jordan_rose@apple.com <mailto:jordan_rose@apple.com>> wrote:

On Mar 11, 2016, at 13:30 , Dave Abrahams <dabrahams@apple.com <mailto:dabrahams@apple.com>> wrote:

On Mar 11, 2016, at 11:27 AM, Joe Groff <jgroff@apple.com <mailto:jgroff@apple.com>> wrote:

On Mar 11, 2016, at 11:20 AM, Jordan Rose via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

On Mar 10, 2016, at 15:34 , Dave Abrahams via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

on Wed Mar 09 2016, Jordan Rose <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

This is my concern too. Our guidelines often lead to the first
parameter having a label, but usually that name isn't the same as the
name of the parameter—one's a preposition, the other's a noun. I'm
pretty sure the common case is still unlabeled.

It's about 50/50 (slight edge to labeled first parameters) in the
imported Cocoa APIs.

If it's easy to get these numbers, how many of the first parameters have the same label as the parameter name?

If you're going to measure that, you should also measure it for second, third, ..., Nth parameters too for comparison.

Anyone who wants to measure is free to do so: simple regexps and wc generally work for this purpose.

https://github.com/apple/swift-3-api-guidelines-review/tree/swift-3/Platforms

…in retrospect, probably more of the Cocoa names would match up if they had this shorthand before:

  func beginSheetModal(for window: NSWindow, modalDelegate delegate: AnyObject?, didEnd didEndSelector: Selector, contextInfo contextInfo: UnsafeMutablePointer<Void>)

- for/window is a true difference
- modalDelegate/delegate is just convenience inside the method; it could have easily been modalDelegate/modalDelegate
- didEnd/didEndSelector actually does match up in the original; the importer has (correctly) changed it to not match
- contextInfo/contextInfo is a match

Sorry, I don’t know what you are trying to assert here. Which shorthand? We haven’t introduced any, and nobody’s proposing to add one.

I could have easily screwed up my grep but doing spot checks on the
resulting data sets I didn't spot an issue. I did make assumptions about
how well formed the data set was.

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:554]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* [A-Za-z0-9]*:" Platforms/

wc -l

   10587

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:555]> grep -R "func [A-Za-z0-9]*(_ [A-Za-z0-9]*:" Platforms/ | wc -l
   21654

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:556]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* _:" Platforms/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:557]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]*:" Platforms/ | wc -l
      14

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:558]> grep -R "func [A-Za-z0-9]*()" Platforms/ | wc -l
    7190

···

----

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:559]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* [A-Za-z0-9]*:" SampleCode/

wc -l

      12

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:560]> grep -R "func [A-Za-z0-9]*(_ [A-Za-z0-9]*:" SampleCode/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:561]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* _:" SampleCode/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:562]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]*:" SampleCode/ | wc -l
     512

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:563]> grep -R "func [A-Za-z0-9]*()" SampleCode/ | wc -l
     221

On Mon, Mar 14, 2016 at 3:28 PM Dave Abrahams via swift-evolution < swift-evolution@swift.org> wrote:

on Sun Mar 13 2016, Shawn Erickson <swift-evolution@swift.org> wrote:

> On Fri, Mar 11, 2016 at 1:30 PM Dave Abrahams via swift-evolution < > > swift-evolution@swift.org> wrote:
>
>>
>> Anyone who wants to measure is free to do so: simple regexps and wc
>> generally work for this purpose.
>>
>>
>>
https://github.com/apple/swift-3-api-guidelines-review/tree/swift-3/Platforms
>>
>
> Not sure if anyone actually got around to this so doing a basic set of
> regex (includes class functions and overrides)...
>
> func foo(bar baz:Baz... ---> 10544
> func foo(baz:Baz... ---> 526
> func foo(_:Baz... ---> 92
> func foo() ---> 7392

Are you certain? Last we checked it was about 50/50 between having and
not-having a distinct argument label.

--
-Dave

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Ah, this doesn't distinguish

func foo(bar baz: Int)

from

func foo(bar bar: Int)

That's pretty important for this discussion.

(Thanks for actually doing this! I just let it drop last week.)

Jordan

···

On Mar 14, 2016, at 16:01 , Shawn Erickson via swift-evolution <swift-evolution@swift.org> wrote:

I could have easily screwed up my grep but doing spot checks on the resulting data sets I didn't spot an issue. I did make assumptions about how well formed the data set was.

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:554]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* [A-Za-z0-9]*:" Platforms/ | wc -l
   10587

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:555]> grep -R "func [A-Za-z0-9]*(_ [A-Za-z0-9]*:" Platforms/ | wc -l
   21654

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:556]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* _:" Platforms/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:557]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]*:" Platforms/ | wc -l
      14

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:558]> grep -R "func [A-Za-z0-9]*()" Platforms/ | wc -l
    7190

----

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:559]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* [A-Za-z0-9]*:" SampleCode/ | wc -l
      12

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:560]> grep -R "func [A-Za-z0-9]*(_ [A-Za-z0-9]*:" SampleCode/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:561]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* _:" SampleCode/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:562]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]*:" SampleCode/ | wc -l
     512

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:563]> grep -R "func [A-Za-z0-9]*()" SampleCode/ | wc -l
     221

On Mon, Mar 14, 2016 at 3:28 PM Dave Abrahams via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

on Sun Mar 13 2016, Shawn Erickson <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

> On Fri, Mar 11, 2016 at 1:30 PM Dave Abrahams via swift-evolution < > > swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
>
>>
>> Anyone who wants to measure is free to do so: simple regexps and wc
>> generally work for this purpose.
>>
>>
>> https://github.com/apple/swift-3-api-guidelines-review/tree/swift-3/Platforms
>>
>
> Not sure if anyone actually got around to this so doing a basic set of
> regex (includes class functions and overrides)...
>
> func foo(bar baz:Baz... ---> 10544
> func foo(baz:Baz... ---> 526
> func foo(_:Baz... ---> 92
> func foo() ---> 7392

Are you certain? Last we checked it was about 50/50 between having and
not-having a distinct argument label.

--
-Dave

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Ah, this doesn't distinguish

func foo(bar baz: Int)

from

func foo(bar bar: Int)

That's pretty important for this discussion.

(Thanks for actually doing this! I just let it drop last week.)

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]

[0:574]> grep -R "func [A-Za-z0-9]*(\([A-Za-z0-9]*\) \1:" Platforms/ | wc -l
     274

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:579]> grep -R "func [A-Za-z0-9]*(\([A-Za-z0-9]*\) \1:" Platforms/ | head
-5
Platforms//iOS/AssetsLibrary/ALAssetRepresentation.swift: func
cgImage(options options: [NSObject : AnyObject]! = [:]) ->
Unmanaged<CGImage>!
Platforms//iOS/CloudKit/CKContainer.swift: func
accountStatus(completionHandler completionHandler: (CKAccountStatus,
NSError?) -> Void)
Platforms//iOS/CloudKit/CKContainer.swift: func
fetchUserRecordID(completionHandler completionHandler: (CKRecordID?,
NSError?) -> Void)
Platforms//iOS/CloudKit/CKContainer.swift: func
discoverAllContactUserInfos(completionHandler completionHandler:
([CKDiscoveredUserInfo]?, NSError?) -> Void)
Platforms//iOS/CloudKit/CKDatabase.swift: func
fetchAllRecordZones(completionHandler completionHandler: ([CKRecordZone]?,
NSError?) -> Void)

···

On Mon, Mar 14, 2016 at 8:05 PM Jordan Rose <jordan_rose@apple.com> wrote:

On Mar 14, 2016, at 16:01 , Shawn Erickson via swift-evolution < > swift-evolution@swift.org> wrote:

I could have easily screwed up my grep but doing spot checks on the
resulting data sets I didn't spot an issue. I did make assumptions about
how well formed the data set was.

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:554]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* [A-Za-z0-9]*:" Platforms/
> wc -l
   10587

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:555]> grep -R "func [A-Za-z0-9]*(_ [A-Za-z0-9]*:" Platforms/ | wc -l
   21654

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:556]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* _:" Platforms/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:557]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]*:" Platforms/ | wc -l
      14

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:558]> grep -R "func [A-Za-z0-9]*()" Platforms/ | wc -l
    7190

----

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:559]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* [A-Za-z0-9]*:"
SampleCode/ | wc -l
      12

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:560]> grep -R "func [A-Za-z0-9]*(_ [A-Za-z0-9]*:" SampleCode/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:561]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* _:" SampleCode/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:562]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]*:" SampleCode/ | wc -l
     512

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:563]> grep -R "func [A-Za-z0-9]*()" SampleCode/ | wc -l
     221

On Mon, Mar 14, 2016 at 3:28 PM Dave Abrahams via swift-evolution < > swift-evolution@swift.org> wrote:

on Sun Mar 13 2016, Shawn Erickson <swift-evolution@swift.org> wrote:

> On Fri, Mar 11, 2016 at 1:30 PM Dave Abrahams via swift-evolution < >> > swift-evolution@swift.org> wrote:
>
>>
>> Anyone who wants to measure is free to do so: simple regexps and wc
>> generally work for this purpose.
>>
>>
>>
https://github.com/apple/swift-3-api-guidelines-review/tree/swift-3/Platforms
>>
>
> Not sure if anyone actually got around to this so doing a basic set of
> regex (includes class functions and overrides)...
>
> func foo(bar baz:Baz... ---> 10544
> func foo(baz:Baz... ---> 526
> func foo(_:Baz... ---> 92
> func foo() ---> 7392

Are you certain? Last we checked it was about 50/50 between having and
not-having a distinct argument label.

--
-Dave

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Thank you! I realized one other potential flaw in the data-gathering: your search for "func foo(_ bar" will match both Objective-C methods and C functions. I'm not sure CF should really be contributing to the scores. Unfortunately the main way I can think of to differentiate them is by indentation, which seems a little sketchy.

Still, the conclusions I would draw from this are that the vast majority of methods fall into one of the three following categories:

- No arguments.
- Empty first argument label.
- First argument label that does not match the parameter name.

This doesn't mean we shouldn't change the convention—"_ completionHandler" is much easier to type than "completionHandler completionHandler", and it's still removing complexity—but it does mean (to me) that the new API naming guidelines don't make the "matching" case more important; they only make the "no label" case less important.

Jordan

···

On Mar 14, 2016, at 20:30 , Shawn Erickson <shawnce@gmail.com> wrote:

On Mon, Mar 14, 2016 at 8:05 PM Jordan Rose <jordan_rose@apple.com <mailto:jordan_rose@apple.com>> wrote:
Ah, this doesn't distinguish

func foo(bar baz: Int)

from

func foo(bar bar: Int)

That's pretty important for this discussion.

(Thanks for actually doing this! I just let it drop last week.)

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:574]> grep -R "func [A-Za-z0-9]*(\([A-Za-z0-9]*\) \1:" Platforms/ | wc -l
     274

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:579]> grep -R "func [A-Za-z0-9]*(\([A-Za-z0-9]*\) \1:" Platforms/ | head -5
Platforms//iOS/AssetsLibrary/ALAssetRepresentation.swift: func cgImage(options options: [NSObject : AnyObject]! = [:]) -> Unmanaged<CGImage>!
Platforms//iOS/CloudKit/CKContainer.swift: func accountStatus(completionHandler completionHandler: (CKAccountStatus, NSError?) -> Void)
Platforms//iOS/CloudKit/CKContainer.swift: func fetchUserRecordID(completionHandler completionHandler: (CKRecordID?, NSError?) -> Void)
Platforms//iOS/CloudKit/CKContainer.swift: func discoverAllContactUserInfos(completionHandler completionHandler: ([CKDiscoveredUserInfo]?, NSError?) -> Void)
Platforms//iOS/CloudKit/CKDatabase.swift: func fetchAllRecordZones(completionHandler completionHandler: ([CKRecordZone]?, NSError?) -> Void)

On Mar 14, 2016, at 16:01 , Shawn Erickson via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I could have easily screwed up my grep but doing spot checks on the resulting data sets I didn't spot an issue. I did make assumptions about how well formed the data set was.

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:554]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* [A-Za-z0-9]*:" Platforms/ | wc -l
   10587

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:555]> grep -R "func [A-Za-z0-9]*(_ [A-Za-z0-9]*:" Platforms/ | wc -l
   21654

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:556]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* _:" Platforms/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:557]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]*:" Platforms/ | wc -l
      14

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:558]> grep -R "func [A-Za-z0-9]*()" Platforms/ | wc -l
    7190

----

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:559]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* [A-Za-z0-9]*:" SampleCode/ | wc -l
      12

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:560]> grep -R "func [A-Za-z0-9]*(_ [A-Za-z0-9]*:" SampleCode/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:561]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* _:" SampleCode/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:562]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]*:" SampleCode/ | wc -l
     512

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:563]> grep -R "func [A-Za-z0-9]*()" SampleCode/ | wc -l
     221

On Mon, Mar 14, 2016 at 3:28 PM Dave Abrahams via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

on Sun Mar 13 2016, Shawn Erickson <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

> On Fri, Mar 11, 2016 at 1:30 PM Dave Abrahams via swift-evolution < >> > swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
>
>>
>> Anyone who wants to measure is free to do so: simple regexps and wc
>> generally work for this purpose.
>>
>>
>> https://github.com/apple/swift-3-api-guidelines-review/tree/swift-3/Platforms
>>
>
> Not sure if anyone actually got around to this so doing a basic set of
> regex (includes class functions and overrides)...
>
> func foo(bar baz:Baz... ---> 10544
> func foo(baz:Baz... ---> 526
> func foo(_:Baz... ---> 92
> func foo() ---> 7392

Are you certain? Last we checked it was about 50/50 between having and
not-having a distinct argument label.

--
-Dave

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

Thank you! I realized one other potential flaw in the data-gathering: your search for "func foo(_ bar" will match both Objective-C methods and C functions. I'm not sure CF should really be contributing to the scores. Unfortunately the main way I can think of to differentiate them is by indentation, which seems a little sketchy.

Still, the conclusions I would draw from this are that the vast majority of methods fall into one of the three following categories:

- No arguments.

No harm, no foul situation.

- Empty first argument label.

Change would primarily affect adding "_ ", two characters

- First argument label that does not match the parameter name.

No harm, no foul situation.

I still feel that adding consistency outweighs the inconvenience of the two extra characters,
which then show an *intent* that the argument label is empty by choice rather than convention.

-- E

···

On Mar 15, 2016, at 10:41 AM, Jordan Rose via swift-evolution <swift-evolution@swift.org> wrote:

This doesn't mean we shouldn't change the convention—"_ completionHandler" is much easier to type than "completionHandler completionHandler", and it's still removing complexity—but it does mean (to me) that the new API naming guidelines don't make the "matching" case more important; they only make the "no label" case less important.

Jordan

Thank you! I realized one other potential flaw in the data-gathering:
your search for "func foo(_ bar" will match both Objective-C methods
and C functions. I'm not sure CF should really be contributing to the
scores. Unfortunately the main way I can think of to differentiate
them is by indentation, which seems a little sketchy.

In this context, it's not. These are automatically extracted and
formatted APIs.

···

on Tue Mar 15 2016, Jordan Rose <swift-evolution@swift.org> wrote:

Still, the conclusions I would draw from this are that the vast
majority of methods fall into one of the three following categories:

- No arguments.
- Empty first argument label.
- First argument label that does not match the parameter name.

This doesn't mean we shouldn't change the convention—"_
completionHandler" is much easier to type than "completionHandler
completionHandler", and it's still removing complexity—but it does
mean (to me) that the new API naming guidelines don't make the
"matching" case more important; they only make the "no label" case
less important.

Jordan

On Mar 14, 2016, at 20:30 , Shawn Erickson <shawnce@gmail.com> wrote:

On Mon, Mar 14, 2016 at 8:05 PM Jordan Rose >> <jordan_rose@apple.com >> <mailto:jordan_rose@apple.com>> wrote:
Ah, this doesn't distinguish

func foo(bar baz: Int)

from

func foo(bar bar: Int)

That's pretty important for this discussion.

(Thanks for actually doing this! I just let it drop last week.)

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:574]> grep -R "func [A-Za-z0-9]*(\([A-Za-z0-9]*\) \1:" Platforms/ | wc -l
     274

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:579]> grep -R "func [A-Za-z0-9]*(\([A-Za-z0-9]*\) \1:" Platforms/ | head -5
Platforms//iOS/AssetsLibrary/ALAssetRepresentation.swift: func
cgImage(options options: [NSObject : AnyObject]! = [:]) ->
Unmanaged<CGImage>!
Platforms//iOS/CloudKit/CKContainer.swift: func
accountStatus(completionHandler completionHandler: (CKAccountStatus,
NSError?) -> Void)
Platforms//iOS/CloudKit/CKContainer.swift: func
fetchUserRecordID(completionHandler completionHandler: (CKRecordID?,
NSError?) -> Void)
Platforms//iOS/CloudKit/CKContainer.swift: func
discoverAllContactUserInfos(completionHandler completionHandler:
([CKDiscoveredUserInfo]?, NSError?) -> Void)
Platforms//iOS/CloudKit/CKDatabase.swift: func
fetchAllRecordZones(completionHandler completionHandler:
([CKRecordZone]?, NSError?) -> Void)

On Mar 14, 2016, at 16:01 , Shawn Erickson via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I could have easily screwed up my grep but doing spot checks on the resulting data sets I didn't spot an issue. I did make assumptions about how well formed the data set was.

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:554]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* [A-Za-z0-9]*:" Platforms/ | wc -l
   10587

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:555]> grep -R "func [A-Za-z0-9]*(_ [A-Za-z0-9]*:" Platforms/ | wc -l
   21654

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:556]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* _:" Platforms/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:557]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]*:" Platforms/ | wc -l
      14

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:558]> grep -R "func [A-Za-z0-9]*()" Platforms/ | wc -l
    7190

----

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:559]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* [A-Za-z0-9]*:" SampleCode/ | wc -l
      12

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:560]> grep -R "func [A-Za-z0-9]*(_ [A-Za-z0-9]*:" SampleCode/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:561]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]* _:" SampleCode/ | wc -l
       0

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:562]> grep -R "func [A-Za-z0-9]*([A-Za-z0-9]*:" SampleCode/ | wc -l
     512

[shawnce:~/Downloads/swift-3-api-guidelines-review-swift-3]
[0:563]> grep -R "func [A-Za-z0-9]*()" SampleCode/ | wc -l
     221

On Mon, Mar 14, 2016 at 3:28 PM Dave Abrahams via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

on Sun Mar 13 2016, Shawn Erickson <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

> On Fri, Mar 11, 2016 at 1:30 PM Dave Abrahams via swift-evolution < >>> > swift-evolution@swift.org >>> > <mailto:swift-evolution@swift.org>> >>> > wrote:
>
>>
>> Anyone who wants to measure is free to do so: simple regexps and wc
>> generally work for this purpose.
>>
>>
>> https://github.com/apple/swift-3-api-guidelines-review/tree/swift-3/Platforms
>> <https://github.com/apple/swift-3-api-guidelines-review/tree/swift-3/Platforms&gt;
>>
>
> Not sure if anyone actually got around to this so doing a basic set of
> regex (includes class functions and overrides)...
>
> func foo(bar baz:Baz... ---> 10544
> func foo(baz:Baz... ---> 526
> func foo(_:Baz... ---> 92
> func foo() ---> 7392

Are you certain? Last we checked it was about 50/50 between having and
not-having a distinct argument label.

--
-Dave

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
<mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
<mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

--
-Dave