[swift-evolution] [Review] Naming Functions with Argument Labels

Douglas Gregor dgregor at apple.com
Tue Jan 19 21:55:39 CST 2016



Sent from my iPhone

> On Jan 18, 2016, at 11:53 PM, Roopesh Chander via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Doug / Joe,
> 
> Sorry about asking this after the review period: it's not clear to me how the assigned functions can be called.
> 
> In case I have:
> 
>     let fn1 = someView.insertSubview(_:aboveSubview:)
>     let fn2 = someView.insertSubview(_:belowSubview:)
> 
> will the types of both fn1 and fn2 be the same (i.e., (UIView, UIView) -> ())? Will I be able to call them without having to use the aboveSubview/belowSubview labels, like:
> 
>     fn1(view1, view2)
>     fn2(view3, view4)

Right now, you'll still need to use labels in the call. However, this is an area where we'd like to revisit things a bit: having labels in function types seems to cause more trouble than it provides benefits, and I'd like to see up address that directly.

  - Doug


> Thanks,
> roop.
> 
> 
>> On Wed, Jan 13, 2016 at 10:50 PM, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>>> On Jan 13, 2016, at 9:16 AM, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
>>> 
>>> Hello Swift community,
>>> 
>>> The review of "Naming Functions with Argument Labels" begins now and runs through January 10th. The proposal is available here:
>>> 
>>> 	https://github.com/apple/swift-evolution/blob/master/proposals/0021-generalized-naming.md
>> 
>> Sorry, Mail mangled the link here, and the review runs through January 18th. Here's the corrected link:
>> 
>> https://github.com/apple/swift-evolution/blob/master/proposals/0021-generalized-naming.md
>> 
>> -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/20160119/5ecda654/attachment.html>


More information about the swift-evolution mailing list