[swift-evolution] rename dropFirst() and dropLast()

Kevin Ballard kevin at sb.org
Mon Dec 28 18:02:47 CST 2015


On Mon, Dec 28, 2015, at 03:53 PM, Michel Fortin via swift-evolution wrote:
> Le 28 déc. 2015 à 17:27, Daniel Duan via swift-evolution <swift-evolution at swift.org> a écrit :
> 
> > .dropFirst() => .excludeFirst()
> > 
> > What do y’all think?
> 
> Following the new API guidelines, shouldn't the name be either `droppingFirst` or `excludingFirst`? That would solve your problem, right? Many things still need to be adapted to the new conventions.
> 
> https://swift.org/documentation/api-design-guidelines.html#be-grammatical

That's not what the conventions say. They say non-mutating phrases should read as noun phrases when possible. But `droppingFirst` isn't a noun phrase. This means things like `index.successor()`. It also says that if there is no good noun phrase to use then imperative verbs are acceptable, which means it will stay as `dropFirst`.

-Kevin Ballard


More information about the swift-evolution mailing list