<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 30, 2016 at 3:30 PM, Scott James Remnant via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As with the original proposal, your examples here don't obey the Naming Guidelines.<br>
<br>
If we're going to pretend that Swift is C, we wouldn't have a distinction between argument labels and parameter names in the first place!<br>
<br>
Is there an example of two functions, obeying the naming guidelines, which have different argument labels (not parameter names) for parameters of the same type, where it makes sense to cross-call them?<br></blockquote><div><br></div><div>Sure there are. For example, `adding(_:)` and `multiplied(by:)` in the new Integer protocol.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Scott<br>
<div class="HOEnZb"><div class="h5"><br>
> On Jun 30, 2016, at 1:11 PM, Vladimir.S <<a href="mailto:svabox@gmail.com">svabox@gmail.com</a>> wrote:<br>
><br>
> On 30.06.2016 21:56, Scott James Remnant via swift-evolution wrote:<br>
>>> They already *are* type compatible. This works right now:<br>
>>><br>
>>> var a : (ofHits: Int, forRuns: Int) -> Bool = meetsBattingAverage a =<br>
>>> sinkBattleship // ??? a(ofHits: 1, forRuns: 2)<br>
>><br>
>> Your proposal does not make it clear that this works (which is<br>
>> surprising to me).<br>
>><br>
>> I would argue the proposal the other way: that there should be an error<br>
>> on line 2, and this should not be permitted implicitly.<br>
><br>
> I'm not sure if this is a definitely bad thing. Let's assume I have a number of funcs with similar but different labels and I want to define a function variable with another labels and assign one of these funcs:<br>
><br>
> func foo(one: Int, two: Int) {..}<br>
> func bar(first: Int, second: Int) {..}<br>
><br>
> var a : (alfa: Int, betta: Int) -> () = foo<br>
> a(alfa: 1, betta: 2)<br>
> a = bar<br>
> a(alfa: 1, betta: 2)<br>
><br>
> But the type of `a` is still (Int, Int) -> () the same as for `foo` and `bar`<br>
><br>
>><br>
>> Scott _______________________________________________ swift-evolution<br>
>> mailing list <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
>><br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div></div>