> On May 27, 2017, at 10:40 AM, Dave Abrahams via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> A property and an intializer will be added to `String.Index`, exposing
> the offset of the index in code units (currently only UTF-16) from the
> beginning of the string:
> 
> ```swift
> let n: Int = html.endIndex.encodedOffset
> let end = String.Index(encodedOffset: n)
> assert(end == String.endIndex)
> ```


Do you intend to allow users to serialize an `encodedOffset` and deserialize it 
later, perhaps in a later version of Swift, to represent the same position? If 
so, I'm not sure how you intend to maintain compatibility once the "currently 
only UTF-16" notation is no longer true.

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to