<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=""><div class="">Text is not enough to represent whether function are adjectives or verbs. By distinguishing between adjectives (nonmutating) and verbs (mutating) functions, with metadata, we will also be able to settle when to enforce self.&nbsp;</div><div class=""><br class=""></div><div class=""><div class="">When a function is a mutating verb (i.e. when self. really means “self, "), self. reads redundantly.</div></div><div class="">When a function is an adjective (i.e. when self. means “me, "), it doesn’t read well if self. is not used.</div><div class=""><br class=""></div><div class="">sort(…)</div><div class="">self.sorted(…)</div><div class=""><br class=""></div><div class="">append(…)</div><div class="">self.appended(with …)</div><div class=""><br class=""></div><div class="">split(using: …)</div><div class="">self.split(by: …)</div><div class=""><br class=""></div><div class="">cut(…)</div><div class="">self.cut(by: …)</div><div class=""><br class=""></div><div class="">Sometimes, “self.” means “I”, but I don’t believe those cases are relevant to this thread.</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 22, 2016, at 4:53 PM, Joe Groff via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><blockquote type="cite" class=""><ul style="box-sizing: border-box; margin: 1em 0px; padding: 0px 0px 0px 40px; list-style-position: initial; list-style-image: initial; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; font-size: 18px;" class=""><li style="box-sizing: border-box; margin: 0px; padding: 0px;" class="">When&nbsp;<strong style="box-sizing: border-box;" class="">a mutating method is described by a verb, name its non-mutating counterpart</strong>&nbsp;according to the&nbsp;<strong style="box-sizing: border-box;" class="">“ed/ing” rule</strong>, e.g. the non-mutating versions of&nbsp;<code class="highlighter-rouge" style="box-sizing: border-box; font-size: 14px; white-space: nowrap; font-family: Menlo, Consolas, Monaco, 'Courier New', monospace, serif; padding: 3px 8px; border: 1px solid rgb(229, 229, 229); background-color: rgb(247, 247, 247);">x.sort()</code>&nbsp;and&nbsp;<code class="highlighter-rouge" style="box-sizing: border-box; font-size: 14px; white-space: nowrap; font-family: Menlo, Consolas, Monaco, 'Courier New', monospace, serif; padding: 3px 8px; border: 1px solid rgb(229, 229, 229); background-color: rgb(247, 247, 247);">x.append(y)</code>&nbsp;are&nbsp;<code class="highlighter-rouge" style="box-sizing: border-box; font-size: 14px; white-space: nowrap; font-family: Menlo, Consolas, Monaco, 'Courier New', monospace, serif; padding: 3px 8px; border: 1px solid rgb(229, 229, 229); background-color: rgb(247, 247, 247);">x.sorted()</code>&nbsp;and&nbsp;<code class="highlighter-rouge" style="box-sizing: border-box; font-size: 14px; white-space: nowrap; font-family: Menlo, Consolas, Monaco, 'Courier New', monospace, serif; padding: 3px 8px; border: 1px solid rgb(229, 229, 229); background-color: rgb(247, 247, 247);">x.appending(y)</code>.</li></ul></blockquote><div class="">This is a nice rule in theory, but English fights it with the full fury of its irregularity. There are a lot of common operations whose past tense shares a spelling with the infinitive—'split', 'cut', 'read', and 'cast' immediately come to mind. How do you handle naming non-mutating versions of these operations? Conjugating other irregular verbs also imposes a barrier on developers whose first language is not English.</div><div class=""><br class=""></div><div class="">-Joe</div></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>