[swift-evolution] [Review] SE-0180: String Index Overhaul

Dave Abrahams dabrahams at apple.com
Wed Jun 14 08:48:57 CDT 2017


> On Jun 13, 2017, at 6:16 PM, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
> 
> I’m coming to this conversation rather late, so forgive the naive question:
> 
> Your proposal claims that current code with failable APIs is needlessly awkward and that most code only interchanges indices that are known to succeed. So, why is it not simply a precondition of string slicing that the index be correctly aligned? It seems like this would simplify the behavior greatly.

Well, consider the case raised by Kevin Ballard if nothing else: that code would start trapping. 

-Dave


More information about the swift-evolution mailing list