[swift-evolution] Inquiry: Status of SR-122 ?

plx plxswift at icloud.com
Sun Jan 3 07:55:56 CST 2016


Thanks for pointing me at it; at a quick read I like the functionality, but will have to take a closer look to get a sense of its feel in use.

It certainly addresses the current gripes I have around `CollectionType` requiring a `ForwardIndexType`: for all but the truly-linear collections (e.g., Array-like) implementing `successor()` either forces you to hold a back-reference, or leaves you choosing between holding a back-reference or having rather “fat” indices.

If the collection becomes responsible for moving the index this is all mooted; I can finish the sketched refactoring proposal and simply refer to this (prototype? proposal?) as something else that’d be needed to get the full benefit.

> On Jan 2, 2016, at 11:24 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> 
> On Sat, Jan 2, 2016 at 4:53 AM, Dave Abrahams via swift-evolution
> <swift-evolution at swift.org> wrote:
>> 
>>> On Jan 1, 2016, at 4:34 PM, plx via swift-evolution <swift-evolution at swift.org> wrote:
>>> 
>>> I was preparing a proposal-sketch relating to this earlier discussion: http://article.gmane.org/gmane.comp.lang.swift.evolution/1629
>>> 
>>> …which is largely about inserting "intermediate steps” between `SequenceType` and `CollectionType`, but to get the full benefit would likely wind up requiring modifications to the API on the `*Index` types (e.g. `ForwardIndexType`, which at present is required of a `CollectionType`’s `Index`).
>>> 
>>> Searching for prior discussion/work I found this bug: https://bugs.swift.org/browse/SR-122 , and was curious if anything further has happened on that topic?
>> 
>> Yes, Dmitri has been making progress on an implementation.  He may be able to point you at it…
> 
> The prototype is checked in at
> test/Prototypes/CollectionsMoveIndices.swift, feel free to ask me more
> questions about it.
> 
> Dmitri
> 
> -- 
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the swift-evolution mailing list