[swift-evolution] [SHORT Review] SE-0132: Rationalizing Sequence end-operation names

Boris Wang kona.ming at gmail.com
Mon Jul 25 23:21:11 CDT 2016


"When the operation is naturally described by a verb, use the verb’s
imperative for the mutating method and apply the “ed” or “ing” suffix to
name its nonmutating counterpart."

I known it. But, the "verb" here should be a action will change the object.
Not every verb will change the object.

Like the word: peek ,copy.

In socket program, there's a action "peek", just check if there has new
data in socket data buffer, not move out the data(like the API receive()).
It's not "receiving".


Daniel Duan <daniel at duan.org>于2016年7月26日 周二11:39写道:

> Please read the naming section in Swift API design guidelines
> https://swift.org/documentation/api-design-guidelines/#naming
>
>
> Daniel Duan
> Sent from my iPhone
>
> On Jul 25, 2016, at 8:29 PM, Boris Wang via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> I am curious about the reason using "removing",
> What we are doing is not remove, just selecting some elements from the
> original collection.
>
> _______________________________________________
>
>
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160726/0faded0b/attachment.html>


More information about the swift-evolution mailing list