[swift-evolution] rename dropFirst() and dropLast()
dabrahams at apple.com
Tue Dec 29 20:27:57 CST 2015
> On Dec 29, 2015, at 2:55 PM, Kevin Ballard via swift-evolution <swift-evolution at swift.org> wrote:
>> On Tue, Dec 29, 2015, at 01:33 PM, Daniel Duan wrote:
>> For concrete types that conform to CollectionType:
>> [2, 1, 3].removeFirst() // => 2
>> [2, 1, 3].removingFirst() // => [1, 3]
>> seems like what the “non-mutating counterpart” guideline is aiming for. As another example, the guideline includes “stripNewlines()” and “strippingNewlines()”.
>> For SequenceType conforming types that aren’t CollectionTypes, they would be stuck with “removingFirst()”, which, technically, is a noun phrase (again, not my personal favorite). I don’t this result is against anything in the guidelines.
> It's technically not a noun phrase at all. I believe you're thinking of gerunds, where a verb with an -ing ending is used as a noun. But "removing" in "removingFirst()" is not being used as a noun; the method does not represent the act of removing, but instead it returns a new value constructed "by removing first". I believe this is called the Present Participle.
Yes, we got a wad of technical corrections from an Apple linguist that have yet to be applied to the guidelines document. That was one of them.
Sent from my moss-covered three-handled family gradunza
More information about the swift-evolution