<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 25, 2016 at 6:15 PM, Dave Abrahams <span dir="ltr"><<a href="mailto:dabrahams@apple.com" target="_blank">dabrahams@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class=""><br>
on Mon Apr 25 2016, Xiaodi Wu <<a href="http://xiaodi.wu-AT-gmail.com" rel="noreferrer" target="_blank">xiaodi.wu-AT-gmail.com</a>> wrote:<br>
<br>
> Quick thought:<br>
><br>
> Why are you reaching for the "form..." rule for the mutating methods when there<br>
> are clear verb counterparts?<br>
> location: locate<br>
> successor: succeed<br>
<br>
</span>We're not using successor(i) anymore, as noted below, and furthermore<br>
c.succeed(&i) strongly implies the wrong meaning.</blockquote><div><br></div><div>I thought that's what I understood from the email, but in the linked proposal they're still there (as are the many types of Range protocols). Wrong link, or just not updated?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">I didn't consider<br>
using<br>
<br>
c. locate(...:&i ... )<br>
<br>
primarily because I never thought of it and nobody suggested it IIRC,<br>
but I also don't see how it would work in a family with<br>
c.location(after: i) et al. Suggestions?<br></blockquote><div><br></div><div>I didn't read this proposal carefully on its initial presentation for review. Looking at it now, I wonder about the wisdom of "location"--I understand the rationale of avoiding multiple methods named "index" that do different things, but these particular functions return or mutate indices, and nowhere else are these called "locations". If you're asking for possible alternative suggestions to avoid using "index", I'll suggest the following here because I don't recall seeing them offered previously. They read as phrases or sentences:</div><div><br></div><div>```</div><div>// taking inspiration from ForwardIndexType, which is no more...</div><div>c.advancing(_ i: Index, by offset: IndexDistance, limit: Index)</div><div>c.advance(_ i: inout Index, by offset: IndexDistance, limit: Index)</div><div><br></div><div>// or alternatively, using the terminology in the comments that sit above `location`</div><div>c.offsetting(_ i: Index, by n: IndexDistance, limit: Index)</div><div>c.offset(_ i: inout Index, by n: IndexDistance, limit: Index)</div><div><br></div><div>// and then, in place of successor, etc.</div><div>c.incrementing(_ i: Index, limit: Index)</div><div>c.increment(_ i: inout Index, limit: Index)</div><div>c.decrementing(_ i: Index, limit: Index)</div><div>c.decrement(_ i: inout Index, limit: Index)</div><div>```<br></div><div>("'Limit' doesn't read like a phrase," you might say. Well, think of a coupon: "$1 off one tub of margarine. Limit one per purchase. Void if transferred or sold.")</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div class=""><div class="h5"><br>
> On Mon, Apr 25, 2016 at 1:24 PM, Dave Abrahams via swift-evolution<br>
> <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
> on Wed Apr 20 2016, Chris Lattner <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
> > On Apr 10, 2016, at 2:41 PM, Chris Lattner<br>
> > <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:<br>
> ><br>
> > Hello Swift community,<br>
> ><br>
> > The review of "A New Model for Collections and Indices" begins now and<br>
> runs<br>
> > through April 18th. The proposal is available here:<br>
> ><br>
> ><br>
> <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0065-collections-move-indices.md" rel="noreferrer" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0065-collections-move-indices.md</a><br>
><br>
> ><br>
> > Reviews are an important part of the Swift evolution process. All reviews<br>
> > should be sent to the swift-evolution mailing list at:<br>
> > <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
> > or, if you would like to keep your feedback private, directly to the<br>
> review<br>
> > manager.<br>
> ><br>
> > A quick update: the core team met to discuss this. They agreed to accept<br>
> it with<br>
> > some naming-related revisions to the proposal (in response to community<br>
> > feedback). Dave is organizing this feedback, and I’ll send out the formal<br>
> > announcement when that is ready.<br>
><br>
> The final revisions are reflected in the latest version of the<br>
> proposal:<br>
><br>
> <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0065-collections-move-indices.md" rel="noreferrer" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0065-collections-move-indices.md</a><br>
><br>
> Summary:<br>
><br>
> * We decided to take Shawn Erickson's excellent suggestion<br>
> <<a href="http://article.gmane.org/gmane.comp.lang.swift.evolution/14450" rel="noreferrer" target="_blank">http://article.gmane.org/gmane.comp.lang.swift.evolution/14450</a>> to<br>
> use “location” uniformly for index movement, so instead of<br>
> successor(i) and predecessor(i) we have location(after: i) and<br>
> location(before: i).<br>
><br>
> * Since Brent Royal-Gordon pointed out<br>
> <<a href="http://news.gmane.org/find-root.php?message_id=156D8FB1%2d1FD3%2d448E%2d8C70%2d6E7400629BC0%40architechies.com" rel="noreferrer" target="_blank">http://news.gmane.org/find-root.php?message_id=156D8FB1%2d1FD3%2d448E%2d8C70%2d6E7400629BC0%40architechies.com</a><br>
> ><br>
> that two of the three proposed Range protocols would likely disappear<br>
> in future updates, we took another look at all of them. Finding<br>
> `RangeProtocol` itself to be a very weak abstraction, we removed all<br>
> three from the proposal.<br>
><br>
> For those interested in details, implementation work proceeds apace on<br>
> the swift-3-indexing-model branch at<br>
> <<a href="https://github.com/apple/swift/tree/swift-3-indexing-model/stdlib/public/core" rel="noreferrer" target="_blank">https://github.com/apple/swift/tree/swift-3-indexing-model/stdlib/public/core</a><br>
> >.<br>
><br>
> P.S. If anyone is interested in contributing, there are still plenty of<br>
> FIXMEs left for us to handle ;-)<br>
><br>
> --<br>
> Dave<br>
><br>
> _______________________________________________<br>
> swift-evolution mailing list<br>
> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
><br>
<br>
</div></div><span class=""><font color="#888888">--<br>
Dave<br>
</font></span></blockquote></div><br></div></div>