[swift-evolution] [Review] SE-0130: Replace repeating Character and UnicodeScalar forms of String.init

Haravikk swift-evolution at haravikk.me
Sat Jul 23 06:58:49 CDT 2016


> On 22 Jul 2016, at 21:23, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
> 	* What is your evaluation of the proposal?

I think I'm generally in favour (see later).

> 	* Is the problem being addressed significant enough to warrant a change to Swift?

It's pretty minor but disproportionately annoying, so worth addressing.

> 	* Does this proposal fit well with the feel and direction of Swift?

This I'm not sure on, partly because no alternatives are given. In particular I'm wondering whether this could be addressed instead by adding a string literal version of the initialiser, as this should I think giving the compiler an exact match to select instead?

It's tough to weigh in on which is better though, as I don't use this much at all; I do however have a couple of uses of the Character initialiser that I'd be very slightly inconvenienced by if they were removed, but hardly upset about. I just wanted to float that I believe this may be an alternative that hasn't been considered:

	public init(repeating repeatedValue:StringLiteralType, count:Int) { … }
	public mutating func append(_ other:StringLiteralType) { … }

But both alternatives are sufficiently Swift-y, and I'm not too bothered either way so long as the ambiguity is addressed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160723/ef263c93/attachment.html>


More information about the swift-evolution mailing list