<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">There’s remove, which is mutating in that it actually removes the elements from the target. removing, on the other hand is nonmutating and basically gives a copy and then <b class="">removes from the copy</b>.<br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Saagar Jha<br class=""><br class=""><br class=""></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Jul 25, 2016, at 21:21, Boris Wang via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">"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."<br class=""><br class="">I known it. But, the "verb" here should be a action will change the object. Not every verb will change the object.<br class=""><br class="">Like the word: peek ,copy.<br class=""><br class="">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".<br class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">Daniel Duan <<a href="mailto:daniel@duan.org" class="">daniel@duan.org</a>>于2016年7月26日 周二11:39写道:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class="">Please read the naming section in Swift API design guidelines <a href="https://swift.org/documentation/api-design-guidelines/#naming" target="_blank" class="">https://swift.org/documentation/api-design-guidelines/#naming</a></div></div><div dir="auto" class=""><div class=""><br class=""><br class=""><div class="">Daniel Duan</div>Sent from my iPhone</div></div><div dir="auto" class=""><div class=""><br class="">On Jul 25, 2016, at 8:29 PM, Boris Wang via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div style="white-space:pre-wrap" class="">I am curious about the reason using "removing",<br class="">What we are doing is not remove, just selecting some elements from the original collection.</div>
</div></blockquote></div><div dir="auto" class=""><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span></div></blockquote></div><div dir="auto" class=""><blockquote type="cite" class=""><div class=""><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div></blockquote></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>