I had a similar though some time ago (and even suggested it here) - as e.g. 
"Hello".components(separatedBy: "123") will always produce a non-empty array. 
Even "".components(separatedBy: "") is [""].

Which would allow e.g. first, last and some other members to loose the 
optionality - which would be great. But would probably add unnecessary 
complexity to the stdlib.

Fixed-size arrays do not solve this particular issue that I've noted above.

> On Aug 8, 2017, at 1:39 PM, Tino Heth via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> I think it would make sense to have arrays with a minimal size, but wouldn't 
> consider it very important.
> But there is a long-running discussion about fixed-size arrays, and depending 
> on (if any) solution is chosen for them, your use case could be solved rather 
> easy as well.
> _______________________________________________
> swift-evolution mailing list
> swift-evolution@swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

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

Reply via email to