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

Dave Abrahams dabrahams at apple.com
Wed Jun 14 12:03:17 CDT 2017


on Wed Jun 14 2017, Xiaodi Wu <xiaodi.wu-AT-gmail.com> wrote:

> On Wed, Jun 14, 2017 at 11:13 AM, Dave Abrahams <dabrahams at apple.com> wrote:
>
>>
>> on Wed Jun 14 2017, Xiaodi Wu <xiaodi.wu-AT-gmail.com> wrote:
>>
>> > However, if this desire to remove failable APIs remains strong then I
>> > wonder if the undiscussed second option above is worth at least some
>> > consideration.
>>
>> I think you're misunderstanding the motivation here.  It's not so much
>> that I want to remove failable APIs as that I want to reduce overall API
>> surface area.  The current index conversion APIs contribute 16
>> initializers and 16 methods to the overall size of the library.
>>
>
> Ah, and presumably, having only failable APIs once these different index
> types are collapsed into one would be too cumbersome.

Well, yeah, and impossible.  Collection conformance requires that
subscript return a non-optional Element.

-- 
-Dave


More information about the swift-evolution mailing list