<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important"><a href="https://github.com/Anton3/swift-evolution/blob/master/proposals/NNNN-rename-mirror.md">https://github.com/Anton3/swift-evolution/blob/master/proposals/NNNN-rename-mirror.md</a></p>
<h1 id="rename-mirror-" style="margin:1.3em 0px 1em;padding:0px;font-weight:bold;font-size:1.6em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(221,221,221)">Rename <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code></h1>
<ul style="margin:1.2em 0px;padding-left:2em">
<li style="margin:0.5em 0px">Proposal: <a href="http://NNNN-filename.md">SE-NNNN</a></li>
<li style="margin:0.5em 0px">Author: <a href="https://github.com/Anton3">Anton Zhilin</a>, <a href="https://github.com/DevAndArtist">Adrian Zubarev</a></li>
<li style="margin:0.5em 0px">Status: <strong>Awaiting review</strong></li>
<li style="margin:0.5em 0px">Review manager: TBD</li>
</ul>
<h2 id="introduction" style="margin:1.3em 0px 1em;padding:0px;font-weight:bold;font-size:1.4em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238)">Introduction</h2>
<p style="margin:0px 0px 1.2em!important">Rename <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code> to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">DebugRepresentation</code> and <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">CustomReflectable</code> to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">CustomDebugRepresentable</code>.</p>
<h2 id="motivation" style="margin:1.3em 0px 1em;padding:0px;font-weight:bold;font-size:1.4em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238)">Motivation</h2>
<p style="margin:0px 0px 1.2em!important">Name of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code> does not reflect (no pun) what it is intended to do, i.e. providing full featured reflection, which we want to see in Swift 4. Other than that, it is only intended to serve for debugging purposes, e.g. building trees for selected objects. Some evidence to that:</p>
<ul style="margin:1.2em 0px;padding-left:2em">
<li style="margin:0.5em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror.DisplayStyle</code> contains <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">optional</code> and <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">set</code> as special cases, but does not contain <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">function</code></li>
<li style="margin:0.5em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code> collects all information possible at initialization, while for true reflection we want laziness</li>
<li style="margin:0.5em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code> allows customization. For example, <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Array<T></code> is represented with a field for each of its elements. Do we want this for “true” reflection we want to add in the future?</li>
</ul>
<h2 id="proposed-solution" style="margin:1.3em 0px 1em;padding:0px;font-weight:bold;font-size:1.4em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238)">Proposed solution</h2>
<ul style="margin:1.2em 0px;padding-left:2em">
<li style="margin:0.5em 0px">Rename struct <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code> to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">DebugRepresentation</code></li>
<li style="margin:0.5em 0px">Rename protocol <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">CustomReflectable</code> to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">CustomDebugRepresentable</code></li>
<li style="margin:0.5em 0px">Rename property <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">customMirror</code> to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">customDebugRepresentation</code></li>
<li style="margin:0.5em 0px">Hope that one day we will get a real <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code> with full reflection capabilities</li>
</ul>
<h2 id="impact-on-existing-code" style="margin:1.3em 0px 1em;padding:0px;font-weight:bold;font-size:1.4em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238)">Impact on existing code</h2>
<p style="margin:0px 0px 1.2em!important">This is a breaking change; easy automated migration possible.</p>
<div title="MDH:PGRpdj5odHRwczovL2dpdGh1Yi5jb20vQW50b24zL3N3aWZ0LWV2b2x1dGlvbi9ibG9iL21hc3Rl
ci9wcm9wb3NhbHMvTk5OTi1yZW5hbWUtbWlycm9yLm1kPGJyPjwvZGl2PjxkaXY+PGJyPjwvZGl2
PjxkaXY+IyBSZW5hbWUgYE1pcnJvcmA8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PiogUHJvcG9z
YWw6IFtTRS1OTk5OXShOTk5OLWZpbGVuYW1lLm1kKTwvZGl2PjxkaXY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