<div dir="ltr">On Tue, Jun 28, 2016 at 1:25 PM, David Hart <span dir="ltr">&lt;<a href="mailto:david@hartbit.com" target="_blank">david@hartbit.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
&gt; On 28 Jun 2016, at 13:46, Brent Royal-Gordon &lt;<a href="mailto:brent@architechies.com">brent@architechies.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Unlike the other methods, adding additional elements changed the length of `suffix(from:)`&#39;s return value. That indicates to me that it is *not* a suffix operation at all.<br>
<br>
</span>I don&#39;t agree with your reasoning here. It *is* an operation that returns the suffix (the end of the sequence) but starting from an index. The fact that indices index from the start of the array and that the function will return an array of a different length depending on the argument does not make the result of the operation less of a suffix. It is still returning the end of the array.<br>
</blockquote></div><br></div><div class="gmail_extra">I was in the midst of writing a reply along the same lines, so I figured I&#39;d add to David&#39;s reply here. There are two characteristics I would expect from a method named &quot;prefix&quot; or &quot;suffix&quot;.</div><div class="gmail_extra"><br></div><div class="gmail_extra">First, it should return a subsequence containing zero to count elements. (By contrast, something named &quot;first&quot; should return nil or one element, but certainly no more.)</div><div class="gmail_extra"><br></div><div class="gmail_extra">Second, in the case of &quot;prefix&quot;, the first element of the subsequence (if any) should be the first element of the sequence; in the case of &quot;suffix&quot;, the last element of the subsequence (if any) should be the last element of the sequence.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Now, `suffix(from:)` fulfills both of those expectations. Like David, I do not understand how you arrive at the interpretation that a &quot;suffix operation&quot; should be one that returns a fixed number of elements.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Replacing the word &quot;suffix&quot; with square brackets is inferior, IMO, because at the call site the reader cannot immediately tell that the two characteristics I named above would hold. First, depending on what is inside the square brackets, a subscript could return a subsequence or it could return a single element. Second, depending on what is inside the square brackets, a subsequence could start or end anywhere. By contrast, the words &quot;prefix&quot; and &quot;suffix&quot; clearly communicate what sort of subsequence you&#39;ll get back without inspection of the argument.</div><div class="gmail_extra"><br></div></div>