[swift-evolution] [Accepted] SE-0111: Remove type system significance of function argument labels

David Owens II david at owensd.io
Mon Jul 11 02:17:30 CDT 2016



Sent from my iPhone

> On Jul 10, 2016, at 11:24 PM, Austin Zheng <austinzheng at gmail.com> wrote:
> 
> 
>> On Jul 10, 2016, at 11:16 PM, David Owens II <david at owensd.io> wrote:
>> 
>> Unless you really want to try and get parameter name syntax changed to match your example:
>> 
>> func doResizeB(image: Image, completed(original:resized:): (Image, Image) -> Void)
> 
> This is what I had in mind. You would be able to name a value of function type (whether it be a local variable, function argument, or property) with either a simple name (in which case there would be no labels at all), or a compound name with as many semicolons as arguments. Would you have any objection to this?

Would this compound name also affect how functions are referenced? I would assume no. 

Also, how do typealiases work then? It's still desirable to not have to couple the labels there with the labels within the function declaration. So if:

typealias MyCallback = (original: Image, resized: Image) -> Void

Meant that these were equivalent:

func doResizeB(image: Image, completed(original:resized:): (Image, Image) -> Void)

func doResizeB(image: Image, completed: MyCallback)

I probably wouldn't have any real objection. 

-David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160711/b59ae070/attachment.html>


More information about the swift-evolution mailing list