[swift-evolution] [Guidelines, First Argument Labels]: Prepositions inside the parens

Matt Whiteside mwhiteside.dev at gmail.com
Tue Feb 9 17:53:57 CST 2016


> On Feb 9, 2016, at 13:55, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> on Tue Feb 09 2016, Xiaodi Wu <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> 
>> I'm having trouble with this example in 3(a):
>> ```
>> x.loadValues(forKeys: ["fox", "box", "lox"])
>> ```
>> 
>> Based on the preceding discussion, I understand that the above is
>> preferred by the working group over the following:
>> 
>> ```
>> x.loadValuesFor(keys: ["fox", "box", "lox"])
>> ```
> 

I had trouble with that example too.


> More than being compelled by that specific example, when we looked
> through how Cocoa imported with splitting basenames both before and
> after prepositions, it became immediately obvious that on the whole, it
> was much better to split before the preposition.

But that sounds reasonable.


>> Going by the guidelines, though, it seems like the first option is
>> also now preferred by the working group over the unlabeled version
>> below (which admittedly is only an option because 'keys' is not
>> duplicating type information):
>> 
>> ```
>> x.loadValuesForKeys(["fox", "box", "lox"])
>> ```
> 
> Yes, on balance, that's the direction we are leaning.

That seems fine,  based on the above.

> 
>> Is it really the case that the first option is preferred over the
>> third? It does look as though it is, based on this in the diff:
>> ```
>> - func respondWith(data: Data)
>> + func respond(withData data: Data)
>> ```
> 
> Yes.
> 
>> Whichever one is preferred, could the guidelines be clarified in that
>> respect? 
> 
> Yes.

I haven’t read the entire document so I can’t say if more clarity is needed, but I hope to have a chance to read it later.

Matt

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


More information about the swift-evolution mailing list