<div dir="ltr">One can consider everything inside the parentheses to be an argument list and read them as "with/using an argument list". It works well if the preceding part has a verb, such as <div><br></div><div>copy(zone: ...) </div><div>-> "Copy with [a single argument] zone equal to ..."</div><div><div><br></div><div>func doSomethingWith(completionHandler: (()->Void)? = nil) </div><div>-> "doSomething with a given completion handler or do something with a default argument list."<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Not sure if there's any value in spelling it out. I believe we use "with" so it in Objective-C mostly out of necessity and can easily omit it in Swift.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Ilya.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 6, 2016 at 10:12 PM, Matthew Judge 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">This issue is going to surface any time a method with a preposition and a single defaulted argument. I would say:<br>
<br>
copy(with: )<br>
<br>
Although I think we might have problematic results no matter what guidelines we use for<br>
<br>
func doSomethingWith(completionHandler: (()->Void)? = nil)<br>
<br>
since this can be called as<br>
<br>
doSomethingWith() // doSomething()<br>
<br>
Or<br>
<br>
doSomethingWith {...} // doSomething {...}<br>
<div class=""><div class="h5"><br>
> On Feb 6, 2016, at 15:47, Jean-Daniel Dupas via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
><br>
>> Le 6 févr. 2016 à 21:15, Douglas Gregor via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> a écrit :<br>
>><br>
>><br>
>><br>
>> Sent from my iPhone<br>
>><br>
>>> On Feb 6, 2016, at 9:21 AM, Thorsten Seitz <<a href="mailto:tseitz42@icloud.com">tseitz42@icloud.com</a>> wrote:<br>
>>><br>
>>> So the preposition should move into the argument label if the argument is optional?<br>
>>><br>
>>> copy(withZone: zone = nil)<br>
>><br>
>> Zone is redundant with type information.<br>
>><br>
>> copy(with:)?<br>
>> copy(withZone:)?<br>
><br>
> Wouldn’t it be possible to simply drop the copyWithZone: method that is deprecated for some times now (To quote the doc: Zones are ignored on iOS and 64-bit runtime on OS X. You should not use zones in current development).<br>
><br>
>><br>
>>> -Thorsten<br>
>>><br>
>>><br>
>>>> Am 06.02.2016 um 14:45 schrieb Matthew Judge via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>:<br>
>>>><br>
>>>> Very first method<br>
>>>><br>
>>>> copyWith(zone: Zone = nil)<br>
>>>><br>
>>>> can be called as<br>
>>>><br>
>>>> copyWith()<br>
>>>><br>
>>>> I'm assuming this is still something we don't want right?<br>
>>>><br>
>>>>> On Feb 6, 2016, at 02:16, Douglas Gregor via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>>>>><br>
>>>>><br>
>>>>>> On Feb 5, 2016, at 1:32 PM, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>>>>>><br>
>>>>>><br>
>>>>>> Given all the awesome feedback I've gotten on this thread, I went back<br>
>>>>>> to the drawing board and came up with something new; I think this one<br>
>>>>>> works. The previously-stated goals still apply:<br>
>>>>><br>
>>>>>> [snip goals]<br>
>>>>><br>
>>>>>> P.S. Doug is presently working on generating new importer results, based<br>
>>>>>> on these guidelines, for your perusal. They should be ready soon.<br>
>>>>><br>
>>>>> Here’s a link:<br>
>>>>><br>
>>>>> <a href="https://github.com/apple/swift-3-api-guidelines-review/pull/10/files" rel="noreferrer" target="_blank">https://github.com/apple/swift-3-api-guidelines-review/pull/10/files</a><br>
>>>>><br>
>>>>> Feedback welcome!<br>
>>>>><br>
>>>>> - Doug<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>
>>>> _______________________________________________<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>
>> _______________________________________________<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>
><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>
_______________________________________________<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></div>