[swift-evolution] When to use argument labels (a new approach)
charles at charlesism.com
Thu Feb 4 13:22:37 CST 2016
> Why isn't "to" more predictable than "toPoint?" It's certainly more
Function arguments can be unordered, if they have default values. A
contrived example here...
func rename( from nameA="index", from extA="html", to nameB="converted", to
Maybe I'm confused, but that seems like it has to be illegal at worst, and
confusing at best. But if you don't consistently use "from" and "to" then
you're back to making special rules about everything.
It wouldn't matter if every argument has a unique Type, or if you take the
time to create structs or tuples to bundle every piece of data together
about "from" or about "with" etc. Maybe that's usually the case, but it's
nice to have freedom to be lazy.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution