I agree with Brent that offering description on Arrays where it "shouldn't be presented to the user in raw form, ever, so the use case here is debugging” is misleading.
I think it's a bit too absolute—there are a few applications where users could interact with the raw form of an array but these are mostly programming tools ;-). I don't, however see how Dmitri's statement is in any way misleading.
Is there any specific reason for them to offer it?
Who is "them" and what is "it?"
Also, there is a slightly difference in representation of description and debugDescription for ContiguousArray and ArraySlice. If the motivation behind it is unclear it might be worth to remove either the difference in implementation or the conformance to CustomStringConvertible altogether.
Removing the conformance would make their printed representation useless and/or needlessly verbose depending on how you did it (try it yourself).
Dmitri's example is the driving use-case: when you print a string you want the literal contents, but when you print an array of strings you want the strings quoted, and to get the quoted representation of the elements when they are strings you need String(reflecting: arrayElement), not String(arrayElement).
Wiadomość napisana przez Dave Abrahams via swift-dev <email@example.com <mailto:firstname.lastname@example.org>> w dniu 12.12.2015, o godz. 21:41:
Sent from my moss-covered three-handled family gradunza
It would similarly be nice if String.init(_: Any) were instead String.init(_: CustomStringConvertible), and passing something to it that wasn’t convertible was an error.
Why would that be nice? It is an explicit goal that every type can be represented as a string, whatever its conformance a, FWIW
swift-dev mailing list
On Dec 13, 2015, at 12:43 PM, Wojciech Czekalski <email@example.com> wrote:
On Dec 12, 2015, at 9:09 AM, Brent Royal-Gordon via swift-dev <firstname.lastname@example.org <mailto:email@example.com>> wrote: