<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="">Hi Dave,<div class=""><br class=""></div><div class="">I don't think any progress has been made on this specific issue. Slava made a comment a week ago (<a href="https://github.com/apple/swift/pull/838" class="">https://github.com/apple/swift/pull/838</a>, search "This looks like a QoI regression to me"), but nothing since then.</div><div class=""><br class=""></div><div class="">I'm planning on spending today to work on resolving some of the other issues that were brought up in the PR; maybe we can pick up the conversation again after I update it. Let me know what you prefer.</div><div class=""><br class=""></div><div class="">Best,</div><div class="">Austin </div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 18, 2016, at 12:05 AM, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">on Tue Jan 05 2016, Austin Zheng via swift-evolution <</span><a href="http://swift-evolution-m3fhrko0vlzytjvyw6ydsg-at-public.gmane.org/" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution-m3FHrko0VLzYtjvyW6yDsg-AT-public.gmane.org</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Here are a couple of examples I had in mind.<br class=""><br class="">* Arrays (from test/1_stdlib/Runtime.swift:1348), dumping an array with 5<br class="">elements:<br class=""><br class="">BEFORE:<br class="">▿ 5 elements<br class="">- [0]: a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.MacWrite<br class="">- [1]: a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.MacPaint<br class="">- [2]: a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.FileMaker<br class="">▿ [3]: a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.ClarisWorks<br class=""> - ClarisWorks: true<br class=""> ▿ [4]:<br class="">a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.HyperCard<br class=""> - HyperCard: false<br class=""><br class="">AFTER:<br class="">▿ [a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.MacWrite,<br class="">a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.MacPaint,<br class="">a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.FileMaker,<br class="">a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.ClarisWorks(true),<br class="">a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.HyperCard(false)]<br class="">- [0]: a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.MacWrite<br class="">- [1]: a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.MacPaint<br class="">- [2]: a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.FileMaker<br class="">▿ [3]:<br class="">a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.ClarisWorks(true)<br class=""> - ClarisWorks: true<br class=""> ▿ [4]:<br class="">a.MultiPayloadTagBitsSmallNonGenericEnumWithDefaultMirror.HyperCard(false)<br class=""> - HyperCard: false<br class=""><br class="">* Dictionaries (from test/1_stdlib/ReflectionHashing.swift:43):<br class=""><br class="">BEFORE:<br class="">▿ 5 key/value pairs<br class=""> ▿ [0]: (2 elements)<br class=""> - .0: Four<br class=""> - .1: 4<br class=""> ▿ [1]: (2 elements)<br class=""> ...<br class=""><br class="">AFTER:<br class="">▿ ["Four": 4, "One": 1, "Two": 2, "Five": 5, "Three": 3]<br class=""> ▿ [0]: ("Four", 4)<br class=""> - .0: "Four"<br class=""> - .1: 4<br class=""> ▿ [1]: ("One", 1)<br class=""> ...<br class=""><br class="">* Dumping a CGRect (from test/1_stdlib/Reflection_objc.swift):<br class=""><br class="">BEFORE:<br class="">(50.0, 60.0, 100.0, 150.0)<br class=""><br class="">AFTER:<br class="">__C.CGRect(origin: __C.CGPoint(x: 50.0, y: 60.0), size: __C.CGSize(width:<br class="">100.0, height: 150.0))<br class=""><br class="">Let me know if you'd like more, although most are variants on the above.<br class=""><br class="">Best,<br class="">Austin<br class=""><br class="">On Tue, Jan 5, 2016 at 5:37 PM, Dave Abrahams <<a href="mailto:dabrahams@apple.com" class="">dabrahams@apple.com</a>> wrote:<br class=""><br class=""><blockquote type="cite" class=""><br class="">On Jan 5, 2016, at 5:28 PM, Austin Zheng via swift-evolution <<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">Hi Joe,<br class=""><br class="">I respect the choice of the team to use Custom[Debug]StringConvertible in<br class="">lieu of summary. At the same time, in my opinion the output of dump() has<br class="">become significantly more difficult to read (c.f. unit tests in<br class=""><a href="https://github.com/apple/swift/pull/838/files" class="">https://github.com/apple/swift/pull/838/files</a>).<br class=""><br class=""><br class="">Specific examples of readability regressions, please?<br class=""><br class="">Would you and the team be open to exploring alternative solutions that<br class="">improve the readability of dump() without increasing API surface area?<br class=""><br class=""><br class="">Sure.<br class=""><br class="">For example, perhaps the reflection machinery itself should have special<br class="">handling for some of the built-in types. If not, I'll consider this<br class="">discussion thread complete.<br class=""><br class="">Thanks,<br class="">Austin<br class=""><br class=""><br class=""><br class="">On Tue, Jan 5, 2016 at 3:22 PM, Jordan Rose <<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>> wrote:<br class=""><br class=""><blockquote type="cite" class="">Getting custom summaries for the common CG types certainly seems<br class="">reasonable. We'd have to get approval from the appropriate teams at Apple,<br class="">but I can't see any objections.<br class=""><br class="">Jordan<br class=""><br class=""><br class="">On Dec 30, 2015, at 9:55, Joe Groff via swift-evolution <<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">I believe 'summary' is obsolete, and you're supposed to use<br class="">Custom[Debug]StringConvertible to customize your type's reporting now.<br class=""><br class="">-Joe<br class=""><br class="">On Dec 29, 2015, at 10:38 PM, Austin Zheng via swift-evolution <<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">Hi all,<br class=""><br class="">I'd like to gauge reaction for a proposal I was considering: adding to<br class="">the standard library's Mirror type a 'summary' property, and the option to<br class="">initialize a Mirror with a custom summary. If no custom summary is<br class="">provided, the summary would default to the string produced by calling<br class="">String(reflecting: subject) on the subject at the time of mirror creation.<br class=""><br class="">Some context: right now, there are two APIs for mirrors in the standard<br class="">library: CustomReflectable, which is publicly exposed and relies on the<br class="">conforming type creating a Mirror object, and _Reflectable, which relies on<br class="">the conforming type having a companion type conforming to _MirrorType. A<br class="">short-term goal is to migrate the standard library's types off the<br class="">_Reflectable API and have them use the CustomReflectable API, and changing<br class="">dump() accordingly.<br class=""><br class="">The extant implementation of dump() uses a property on _MirrorType called<br class="">"summary". (This is where e.g. "4 elements" comes from when you dump() an<br class="">array.) "summary" is absent from Mirror or any types related to<br class="">CustomReflectable. I asked Joe Groff about this and the rationale was that<br class="">it was deemed too similar to debugDescription (or String(reflecting: foo))<br class="">to be worth carrying over.<br class=""><br class="">I would like to suggest that there might be a purpose for "summary":<br class=""><br class="">- Types with children, especially container types like arrays, often<br class="">print out a description of their children as part of their debugDescription<br class="">or description, redundant when using an API like dump() which provides a<br class="">structural representation of the children of the subject. In such cases a<br class="">lighter-weight description (like "3 elements") might be more appropriate to<br class="">represent to the user.<br class=""><br class="">- Certain types like CGRect don't conform to CustomStringConvertible,<br class="">CustomDebugStringConvertible, Streamable, etc. Having a custom summary for<br class="">these types customized by the corresponding Mirror would allow for a<br class="">'pretty' representation during reflection in lieu of the ugly one generated<br class="">by the runtime without making more substantial changes to the API which<br class="">might break third-party code (such as conforming CGRect to any of the<br class="">aforementioned protocols).<br class=""><br class="">I know that Mirror (and reflection as a whole) are being considered for<br class="">major design changes, so this would be a minor transient change to make the<br class="">API easier to work with in the meantime.<br class=""><br class="">Please let me know whether or not you think this proposed change is<br class="">meaningful and worthwhile, or if you have any questions.<br class=""><br class="">Best,<br class="">Austin<br class=""></blockquote></blockquote></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Hey, Austin,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Is this still something we need to discuss, or did it get resolved</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">somehow?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Thanks,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Dave</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></div></body></html>