Re: [swift-users] Subsequences and shared indices

2016-10-16 Thread Hooman Mehr via swift-users
Thanks to Ole Begemann (who closed my bug report), I found out that Nate Cook submitted a fix for this issue a few day ago. The fix will hopefully make it to the next maintenance release of Swift. The documentation of range subscript (which is the main

Re: [swift-users] Subsequences and shared indices

2016-10-16 Thread Dave Abrahams via swift-users
on Thu Oct 13 2016, Tim Vermeulen wrote: > Is it a requirement that collections share indices with its > subsequence? Yes. > Array and ArraySlice do share indices, which is why ArraySlice isn’t > zero-based, and I think this is convenient. But String.CharacterView > doesn’t seem to share indi

Re: [swift-users] Subsequences and shared indices

2016-10-13 Thread Hooman Mehr via swift-users
`Slice` family of types (there are many) are well documented to share the indices and inherit the semantics. All collections that have a SubSequence of a Slice type, share indices. Unfortunately, standard library is not well documented in general and collection API have undergone big changes in

Re: [swift-users] Subsequences and shared indices

2016-10-13 Thread Tim Vermeulen via swift-users
Alright. Does this mean that we can otherwise assume that collections share indices with their subsequences? It might be worth documenting, one way or the other. > On 14 Oct 2016, at 02:40, Hooman Mehr wrote: > > This is a bug reported multiple times in different forms. My version of it > is:

Re: [swift-users] Subsequences and shared indices

2016-10-13 Thread Hooman Mehr via swift-users
This is a bug reported multiple times in different forms. My version of it is: SR-1487 . It remains open because it is not easy to fix with the existing design of String. Apparently core standard library team are working on an overhaul of String to addres

[swift-users] Subsequences and shared indices

2016-10-13 Thread Tim Vermeulen via swift-users
Is it a requirement that collections share indices with its subsequence? Array and ArraySlice do share indices, which is why ArraySlice isn’t zero-based, and I think this is convenient. But String.CharacterView doesn’t seem to share indices with its subsequence (which is String.CharacterView as