[swift-evolution-announce] [Accepted] SE-0173: Add MutableCollection.swapAt(_:_:)
kremenek at apple.com
Sat Apr 29 14:00:14 CDT 2017
Proposal Link: https://github.com/apple/swift-evolution/blob/master/proposals/0173-swap-indices.md <https://github.com/apple/swift-evolution/blob/master/proposals/0173-swap-indices.md>
The review of “SE-0173: Add MutableCollection.swapAt(_:_:)” (originally named "Add MutableCollection.swap(_:with:)”) ran from April 25...28, 2017.
The proposal is accepted, including the revision to change the method name from “swap(_:with:)” to “swapAt(_:_)” that came out of the Core Team meeting.
The consensus on swift-evolution was to add the method, with division mostly on the naming of the method. The Core Team reviewed the proposed options as well as consulted the API design guidelines to resolve the issue:
Two important points from the guidelines serve to us well here:
"Omit all labels when arguments can’t be usefully distinguished”
"When the first argument forms part of a prepositional phrase, give it an argument label...An exception arises when the first two arguments represent parts of a single abstraction….In such cases, begin the argument label after the preposition, to keep the abstraction clear."
The combination of these rules leads to the method name “swapAt(_:_:)”, which the Core Team believes was most in line with the guidelines. The proposal is accepted with this revision.
Thanks to everyone who participated in the review!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution-announce