<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 8, 2016 at 5:23 AM, Dave Abrahams via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
on Mon Feb 08 2016, Thorsten Seitz &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
<br>
&gt; I agree that positioning the preposition depending on whether a<br>
&gt; default value is present is unfortunate, but I don&#39;t agree that it<br>
&gt; would complicate the rules significantly as it just adds a very simple<br>
&gt; special case for one rule.<br>
<br>
</span>Heh, but then people will really demand a special case for move(from: a,<br>
to: b)<br>
<span class=""><br>
<br>
&gt; Is the problem that it complicates API evolvement significant enough<br>
&gt; to outweigh the advantage of this rule?<br>
<br>
</span>That&#39;s one problem.  I think we should also be concerned about rules<br>
that create a feeling of non-uniformity and un-predictability across<br>
code.  For example, you don&#39;t want to see something like this:<br>
<br>
       removeAllBricks(having: .CrackleGlazeFinish)<br>
<br>
       removeAllBeamsHaving(.RottenWood)<br>
<span class=""><br></span></blockquote><div><br></div><div>I just thought of another point in favor of prepositions going inside parentheses: verbs that take an optional indirect object, expressed as an overload.</div><div><br></div><div>protocol Message {</div><div>  // Stores the whole message</div><div>  func store(toCoreDataEntity tableName: String)</div><div>  func store(toUserDefaults key: String)</div><div><br></div><div>  // Stores only a single field within the message</div><div>  func store(field: String, toCoreDataEntity tableName: String)</div><div>  func store(field: String, toUserDefaults key: String)</div><div>}</div><div><br></div><div>protocol RenderLayer {</div><div>  // Moves the whole layer</div><div>  func move(toDOMElement element: DOMElement, edge: Edge)</div><div><br></div><div>  // Moves an element within the render layer</div><div>  func move(elementWithID id: String, toDOMElement element, edge: Edge)</div><div>  func move(element element: DOMElement, toDOMElement element, edge: Edge)</div><div>}</div><div><br></div><div>With preposition-inside-parentheses, there&#39;s a nice symmetry between these API calls:</div><div><br></div><div>move(toDOMElement: table, edge: .Bottom)   // Whole layer</div><div>move(elementWithID: &quot;#nav&quot;, toDOMElement: table, edge: .Bottom)  // Just one element</div><div><br></div><div>With preposition-outside-parentheses, they become pretty awkward:</div><div><br></div><div>moveTo(DOMElement: table, edge: .Bottom)</div><div>move(elementWithID: &quot;#nav&quot;, toDOMElement: table, edge: .Bottom) // Why different base name?</div><div>moveTo(DOMElement: table, edge: .Bottom, elementWithID: &quot;#nav&quot;) // What&#39;s getting moved?</div><div>moveTo(DOMElement: table, edge: .Bottom, onlyTheElementWithID: &quot;#nav&quot;) // Works, but wordy</div><div><br></div><div>None of this is what I&#39;d consider a deal-breaker, and I know the review period has ended, but if a decision hasn&#39;t been made yet and you&#39;re on the fence, please consider. :-)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
&gt; Closure arguments with default values won&#39;t profit from it if written<br>
&gt; as trailing closure, of course.<br>
&gt;<br>
&gt; No good idea how to remedy that (trailing argument label?? probably not).<br>
<br>
</span>I think that&#39;s a whole &#39;nother bag o&#39; worms, and, yes, some language<br>
syntax might be needed.  IOW, the issue goes beyond mere guidelines.<br>
<div class="HOEnZb"><div class="h5"><br>
&gt; -Thorsten<br>
&gt;<br>
&gt; Am 08. Februar 2016 um 12:47 schrieb Matthew Judge via swift-evolution<br>
&gt; &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt;:<br>
&gt;<br>
&gt;     Agree that basing the preposition location on whether there is a default value is<br>
&gt;     unfortunate. The problem is &quot;Zone&quot; is not redundant/needless when calling it with the<br>
&gt;     default value.<br>
&gt;<br>
&gt;     copyWith()<br>
&gt;<br>
&gt;     If I were asking &quot;what zone?&quot; Ok it&#39;s the default zone, but I&#39;m just asking &quot;with what?&quot;<br>
&gt;<br>
&gt;         On Feb 7, 2016, at 10:48, Dave Abrahams via swift-evolution<br>
&gt;         &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;         on Sat Feb 06 2016, Douglas Gregor &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;                 On Feb 6, 2016, at 10:08 PM, Dave Abrahams via swift-evolution<br>
&gt;                 &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;                     on Sat Feb 06 2016, Thorsten Seitz<br>
&gt;                     &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;                     So the preposition should move into the argument label if the argument is<br>
&gt;                     optional?<br>
&gt;<br>
&gt;                     copy(withZone: zone = nil)<br>
&gt;<br>
&gt;                 That&#39;s a good idea.<br>
&gt;<br>
&gt;             It seems unfortunate that the placement of the preposition should<br>
&gt;<br>
&gt;             change depending on whether there is a default argument or not,<br>
&gt;<br>
&gt;             especially since it is reasonable to imagine that an API evolves to<br>
&gt;<br>
&gt;             gain a default argument later on.<br>
&gt;<br>
&gt;         You&#39;re right; it would complicate the rules significantly, too.<br>
&gt;<br>
&gt;             - Doug<br>
&gt;<br>
&gt;                     -Thorsten<br>
&gt;<br>
&gt;                         Am 06.02.2016 um 14:45 schrieb Matthew Judge via swift-evolution<br>
&gt;<br>
&gt;                         &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt;:<br>
&gt;<br>
&gt;                         Very first method<br>
&gt;<br>
&gt;                         copyWith(zone: Zone = nil)<br>
&gt;<br>
&gt;                         can be called as<br>
&gt;<br>
&gt;                         copyWith()<br>
&gt;<br>
&gt;                         I&#39;m assuming this is still something we don&#39;t want right?<br>
&gt;<br>
&gt;                             On Feb 6, 2016, at 02:16, Douglas Gregor via swift-evolution<br>
&gt;<br>
&gt;                             &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;                                 On Feb 5, 2016, at 1:32 PM, Dave Abrahams via swift-evolution<br>
&gt;<br>
&gt;                                 &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt;<br>
&gt;                                 wrote:<br>
&gt;<br>
&gt;                                 Given all the awesome feedback I&#39;ve gotten on this thread, I<br>
&gt;                                 went back<br>
&gt;<br>
&gt;                                 to the drawing board and came up with something new; I think<br>
&gt;                                 this one<br>
&gt;<br>
&gt;                                 works. The previously-stated goals still apply:<br>
&gt;<br>
&gt;                                 [snip goals]<br>
&gt;<br>
&gt;                                 P.S. Doug is presently working on generating new importer<br>
&gt;                                 results, based<br>
&gt;<br>
&gt;                                 on these guidelines, for your perusal. They should be ready<br>
&gt;                                 soon.<br>
&gt;<br>
&gt;                             Here’s a link:<br>
&gt;<br>
&gt;                             <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>
&gt;<br>
&gt;                             Feedback welcome!<br>
&gt;<br>
&gt;                             - Doug<br>
&gt;<br>
&gt;                             _______________________________________________<br>
&gt;<br>
&gt;                             swift-evolution mailing list<br>
&gt;<br>
&gt;                             <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt;<br>
&gt;                             <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
&gt;<br>
&gt;                         _______________________________________________<br>
&gt;<br>
&gt;                         swift-evolution mailing list<br>
&gt;<br>
&gt;                         <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt;<br>
&gt;                         <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
&gt;<br>
&gt;                     _______________________________________________<br>
&gt;<br>
&gt;                     swift-evolution mailing list<br>
&gt;<br>
&gt;                     <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt;<br>
&gt;                     <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
&gt;<br>
&gt;                 --<br>
&gt;<br>
&gt;                 -Dave<br>
&gt;<br>
&gt;                 _______________________________________________<br>
&gt;<br>
&gt;                 swift-evolution mailing list<br>
&gt;<br>
&gt;                 <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt;<br>
&gt;                 <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
&gt;<br>
&gt;             _______________________________________________<br>
&gt;<br>
&gt;             swift-evolution mailing list<br>
&gt;<br>
&gt;             <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt;<br>
&gt;             <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
&gt;<br>
&gt;         --<br>
&gt;<br>
&gt;         -Dave<br>
&gt;<br>
&gt;         _______________________________________________<br>
&gt;<br>
&gt;         swift-evolution mailing list<br>
&gt;<br>
&gt;         <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt;<br>
&gt;         <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     swift-evolution mailing list<br>
&gt;     <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt;     <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; swift-evolution mailing list<br>
&gt; <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt; <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>
-Dave<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>