Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-07-11 Thread Dave Abrahams via swift-evolution
on Fri Jul 08 2016, Brent Royal-Gordon wrote: >> On Jul 1, 2016, at 3:50 PM, Dave Abrahams via swift-evolution >> wrote: >>> • Redesigning `prefix(upTo:)`, `prefix(through:)` and `suffix(from:)` >>> as subscripts with "partial" ranges, like `people[..

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-07-08 Thread Brent Royal-Gordon via swift-evolution
> On Jul 1, 2016, at 3:50 PM, Dave Abrahams via swift-evolution > wrote: >> • Redesigning `prefix(upTo:)`, `prefix(through:)` and `suffix(from:)` >> as subscripts with "partial" ranges, like `people[..> `people[nil.. > Yes please; I really

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-07-05 Thread Sean Heber via swift-evolution
That’s pretty neat - although I’d inevitably forget and end up writing it with spaces between the “arguments" and the “operator”: someCollection[* … idx] But maybe even that could be made to work with some cleverness. l8r Sean > On Jul 5, 2016, at 1:45 PM, Dave Abrahams via swift-evolution

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-07-05 Thread Dave Abrahams via swift-evolution
on Sun Jul 03 2016, Nevin Brackett-Rozinsky wrote: > The incomplete range concept is quite intriguing. > > Have we considered spelling the operators with an asterisk at the > incomplete end? > prefix *..< > prefix *... > postfix ...* > postfix ..<* > > That way the

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-07-03 Thread Nevin Brackett-Rozinsky via swift-evolution
The incomplete range concept is quite intriguing. Have we considered spelling the operators with an asterisk at the incomplete end? prefix *..< prefix *... postfix ...* postfix ..<* That way the use-sites would look like: someCollection[*..

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-07-01 Thread Dave Abrahams via swift-evolution
on Thu Jun 23 2016, Brent Royal-Gordon wrote: > As previously threatened mentioned, I've written a draft proposal to > fix a number of naming issues with APIs operating on the beginning and > end of Sequences and Collections: > > • Inconsistent use of

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-29 Thread L. Mihalkovic via swift-evolution
@brent: i noticed that you have the habit of redacting out the name of the people from your replies. Considering you seem to be the only one, and how much clarity it removes from the dialog, do you think you could perhaps reconsider? Regards LM (From mobile) On Jun 29, 2016, at 12:40 AM, Brent

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-28 Thread Xiaodi Wu via swift-evolution
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

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-28 Thread David Hart via swift-evolution
> On 29 Jun 2016, at 00:40, Brent Royal-Gordon wrote: > > 2. Measured *relative* to the beginning/end. This is the crux of our disagreement :) I don’t agree with point number 2.___ swift-evolution mailing list

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-28 Thread Brent Royal-Gordon via swift-evolution
> 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". > > First, it should return a subsequence containing zero to count elements. (By > contrast,

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-28 Thread Xiaodi Wu via swift-evolution
On Tue, Jun 28, 2016 at 1:25 PM, David Hart wrote: > > > > On 28 Jun 2016, at 13:46, Brent Royal-Gordon > wrote: > > > > Unlike the other methods, adding additional elements changed the length > of `suffix(from:)`'s return value. That indicates to me

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-28 Thread David Hart via swift-evolution
> On 28 Jun 2016, at 13:46, Brent Royal-Gordon wrote: > > Unlike the other methods, adding additional elements changed the length of > `suffix(from:)`'s return value. That indicates to me that it is *not* a > suffix operation at all. I don't agree with your reasoning

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-28 Thread Patrick Smith via swift-evolution
Hi Brent, Will an IncompleteRange always be able to be translated into the same concrete Range? i.e., the missing bound is just a stand in for startIndex or endIndex right? It seems unfortunate to have this throw away value that is only used as an intermediary. Especially when Collection

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-28 Thread Brent Royal-Gordon via swift-evolution
Addressing the same issue from several people: > On Jun 23, 2016, at 11:28 AM, David Hart wrote: > > I’m not a fan of the subscript solutions. They both introduce new types which > seems very heavyweight for such a small use case. I’d vote for keeping the > current

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-27 Thread Brent Royal-Gordon via swift-evolution
I apologize for not getting the threading right in this email, Anton; Mail seems to have glitched and lost your message. > • Renaming `index(of:/where:)` to `earliestIndex(…)` and `first(where:)` > to `earliest(where:)` > > -1, because `index` is considered state-of-art. `first` does not exist

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-27 Thread Brent Royal-Gordon via swift-evolution
> Just want to point out that `prefix` and `suffix` may introduce ambiguity, as > they are also imperative verbs. For example, `S.prefix(1)` can be inferred as > prefixing `1` to the sequence, instead of retrieving the prefix of the > sequence. While that is true, I think the types will

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-23 Thread Xiaodi Wu via swift-evolution
On Fri, Jun 24, 2016 at 12:45 AM, Guillaume Lessard via swift-evolution < swift-evolution@swift.org> wrote: > I like this draft. Quickly: > > - “removing” sounds more destructive than “skipping”, so I’d lean towards > using “skipping”. I would be happy with either, though. > - there are two

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-23 Thread Guillaume Lessard via swift-evolution
I like this draft. Quickly: - “removing” sounds more destructive than “skipping”, so I’d lean towards using “skipping”. I would be happy with either, though. - there are two different labels for predicates (where and while). “where” is probably the better label. (some previous discussion had

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-23 Thread Anton Zhilin via swift-evolution
• Renaming all methods which operate on more than one element at the beginning/end to use "prefix" or "suffix", not "first" or "last" +1 • Renaming `index(of:/where:)` to `earliestIndex(…)` and `first(where:)` to `earliest(where:)` -1, because `index` is considered state-of-art. `first` does

Re: [swift-evolution] [Draft] Rationalizing Sequence end-operation names

2016-06-23 Thread David Hart via swift-evolution
Most of your proposal look great to me! Comments inline: > On 23 Jun 2016, at 09:19, Brent Royal-Gordon via swift-evolution > > wrote: > > As previously threatened mentioned, I've written a draft proposal to fix a > number of naming