<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 2, 2016, at 17:28, David Owens II 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=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 2, 2016, at 4:54 PM, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div></blockquote><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">Similarly,<br class=""><br class="">let content = listItemView.text.trimming(characters: .whitespaceAndNewlines)<br class=""><br class="">At least I have some context at the call site what the purpose of<br class="">.whitespaceAndNewlines.<br class=""></blockquote><br class="">You wouldn't say "go to the garden and trim the plant: rhododendrons".<br class="">It isn't necessary for comprehension. Why do you feel characters: is<br class="">necessary here?<br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">Because unlike the English phrase, "trimming" does not have an implicit object set based on the context of a string; what else would you typically trim in a garden other than plant life? I could naturally create an API that allows trimming by a line range or string content, as an example.</div><div class=""><br class=""></div></div><div class=""><div class=""><font face="Menlo" class="">"public func foo() {}".trimmed(text: "public ")</font></div><div class=""><font face="Menlo" class="">longContentWithKnownPreamble.trimmed(lines: 0..<5)</font></div></div><div class=""><div class=""><br class=""></div><div class="">We could make these different APIs as opposed to overloads, though I'm not convinced that they are not simply different ways to trim content.</div></div></div></div></blockquote><br class=""></div><div>That's actually why this one is "trimming", not "trimmed". "trimming" allows a direct object; "trimmed" does not.</div><div><br class=""></div><div>I don't really have a problem with this overload set, although admittedly I can't tell if we're trimming prefixes, suffixes, or both, and I would hope that's consistent between the two.</div><div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div>inputText.trimming(.whitespaceAndNewlines)</div><div>inputText.trimming("public ")</div></blockquote><div><br class=""></div><div>These are both perfectly good noun phrases in English, too: "[get me] the inputText, trimming whitespace and newlines" and "[get me] the inputText, trimming 'public '".</div><div><br class=""></div><div>(But to play David's Advocate, it <i class="">also</i> seems perfectly reasonable in English to say "[get me] the inputText, trimming whitespace and newlin<u class="">e characters</u>" and "[get me] the inputText, trimming <u class="">the string</u><i class=""> </i>'public '".)</div><div><br class=""></div><div>Jordan</div></body></html>