[swift-evolution] When to use argument labels, part DEUX (was: when to use argument labels (a new approach))

David Owens II david at owensd.io
Fri Feb 5 15:49:03 CST 2016


> On Feb 5, 2016, at 1:42 PM, David Hart via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Hello Dave,
> 
> This is really shaping up nicely. Unfortunately, I still have difficulties with:
> 
> a.moveFrom(b, to: c)
> 
> I understand the need to have simply guidelines, but this just reads wrong to me, especially because b and c have equal importance. This is so much better IMHO:
> 
> a.move(from: b, to: c)
> 
> But I’m not sure how to write a simple rule to explain this reasoning.

I agree and I prefer `a.move(from: b, to: c)`. However, I think the rule is pretty clear already:

> Rule: If the first argument is part of a prepositional phrase, put the parenthesis immediately after the preposition. 

"move from" is the prepositional phrase for the function, so move the "from" label into the base name.

-David




More information about the swift-evolution mailing list