I understand that that's your thinking. I just don't understand how you arrived at your rule (2). It's not in the dictionary definition of the words prefix and suffix. Nor do I find any documentation of such a rule in Swift. Nor do I think you've shown that such a rule is necessary for clearing up some actual confusion. Nor do I see that applying the rule and using subscripts yields a superior solution to what we currently have.<br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 28, 2016 at 5:40 PM Brent Royal-Gordon <<a href="mailto:brent@architechies.com">brent@architechies.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> I was in the midst of writing a reply along the same lines, so I figured I'd add to David's reply here. There are two characteristics I would expect from a method named "prefix" or "suffix".<br>
><br>
> First, it should return a subsequence containing zero to count elements. (By contrast, something named "first" should return nil or one element, but certainly no more.)<br>
><br>
> Second, in the case of "prefix", the first element of the subsequence (if any) should be the first element of the sequence; in the case of "suffix", the last element of the subsequence (if any) should be the last element of the sequence.<br>
<br>
I would phrase these things slightly differently. In my thinking, a method with `prefix` or `suffix` in its name:<br>
<br>
1. Operates on a subsequence at the beginning/end of the sequence,<br>
<br>
2. Measured *relative* to the beginning/end.<br>
<br>
An index-based operation doesn't fit this definition because an index is not *relative* to anything—it's an *absolute* position within the sequence.<br>
<br>
Put another way, in my view, "prefix" and "suffix" don't merely mean "anchored at the beginning/end". A prefix or suffix is attached to a "middle". There is no middle in the index-based operations.<br>
<br>
It is, of course, very possible to use methods to express what the index-based operations do:<br>
<br>
friends.upTo(i)<br>
friends.through(i)<br>
friends.from(i)<br>
<br>
But at this point, we've basically arrived at `friends[to: i]` etc.<br>
<br>
--<br>
Brent Royal-Gordon<br>
Architechies<br>
<br>
</blockquote></div>