Makes sense. Thanks for the explanation. --Karim
> On Mar 30, 2017, at 7:43 PM, Ben Cohen <[email protected]> wrote: > > >> On Mar 30, 2017, at 10:05 AM, Karim Nassar via swift-evolution >> <[email protected]> wrote: >> >> >>> Message: 12 >>> Date: Thu, 30 Mar 2017 12:23:13 +0200 >>> From: Adrian Zubarev <[email protected]> >>> To: Ben Cohen <[email protected]> >>> Cc: [email protected] >>> Subject: Re: [swift-evolution] [Pitch] String revision proposal #1 >>> Message-ID: <[email protected]> >>> Content-Type: text/plain; charset="utf-8" >>> >>> I haven’t followed the topic and while reading the proposal I found it a >>> little confusing that we have inconsistent type names. I’m not a native >>> English speaker so that’s might be the main case for my confusion here, so >>> I’d appreciate for any clarification. ;-) >>> >>> SubSequence vs. Substring and not SubString. >>> >>> The word substring is an English word, but so is subsequence (I double >>> checked here). >>> >>> So where exactly is the issue here? Is it SubSequence which is written in >>> camel case or is it Substring which is not? >>> >>> >>> >>> -- >>> Adrian Zubarev >>> Sent with Airmail >> >> >> I’d also be curious if StringSlice was considered, since we have already the >> well-established and seemingly-parallel ArraySlice. >> > > Yup we considered it (I should probably have put it in the Alternatives > Considered section). Also considered: having nothing but String.SubSequence. > In fact it may be Substring is just a typealias for String.SubSequence, > though this would be an implementation detail rather than part of the > proposal. > > The current hope (unrelated to String) is that ArraySlice could be > eliminated, by introducing some kind of “ContiguouslyStored” protocol and > then extending the general Slice when it slices something that conforms to > that. But this can’t be done with Substring because of the small string > optimization. > > The other difference is there’s no common term of art for a slice of an > Array, whereas there is for a slice of a String. > >> —Karim >> >> _______________________________________________ >> swift-evolution mailing list >> [email protected] >> https://lists.swift.org/mailman/listinfo/swift-evolution > _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
