<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 13, 2015, at 12:43 PM, Wojciech Czekalski &lt;<a href="mailto:wczekalski@me.com" class="">wczekalski@me.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I agree with Brent that offering description on Arrays where it&nbsp;"<i class="">shouldn't be presented to the user in raw form, ever, so the use case here is debugging” &nbsp;</i>is misleading. </div></div></blockquote><div><br class=""></div>I think it's a bit too absolute—there are a<i class="">&nbsp;few</i>&nbsp;applications&nbsp;where users could interact with the raw form of an array but these are mostly programming tools ;-). &nbsp;I don't, however see how Dmitri's statement is in any way misleading.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Is there any specific reason for them to offer it? </div></div></blockquote><div><br class=""></div>Who is "them" and what is "it?"</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Also, there is a slightly difference in representation of&nbsp;<font face="Menlo" class="">description </font>and<font face="Menlo" class=""> debugDescription </font>for&nbsp;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.</div></div></blockquote><div><br class=""></div>Removing the conformance would make their printed representation useless and/or needlessly verbose depending on how you did it (try it yourself).</div><div><br class=""></div><div>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).</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">-Wojtek</div><div class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Wiadomość napisana przez Dave Abrahams via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; w dniu 12.12.2015, o godz. 21:41:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""><br class="">Sent from my moss-covered three-handled family gradunza<br class=""><br class=""><blockquote type="cite" class="">On Dec 12, 2015, at 9:09 AM, Brent Royal-Gordon via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:<br class=""><br class="">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.<br class=""></blockquote><br class="">Why would that be nice? &nbsp;It is an explicit goal that every type can be represented as a string, whatever its conformance a, FWIW<br class="">_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-dev" class="">https://lists.swift.org/mailman/listinfo/swift-dev</a><br class=""></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""><div class="">
-Dave<div class=""><br class=""></div><br class="Apple-interchange-newline">

</div>
<br class=""></body></html>