<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 11 Oct 2016, at 23:04, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">Reflection is likely to be tackled in Swift 5, no? </div></blockquote><br class=""><div>I'd think you don’t need reflection that much, because defining</div><div>dynamic classes (and other entities) are solely incremental compiler</div><div>tasks, for which it can use &nbsp;previously compiled meta reference</div><div>information (xref symbols etc).&nbsp;</div><div><br class=""></div><div>Imho in that perspective it is more or less independent</div><div>of reflection. Reflection is as far as I can see is more intended to offer&nbsp;</div><div>meta information at the programming level.?&nbsp;</div><div><br class=""></div><blockquote type="cite" class=""><div class="">So realistically, this could be on track for Swift 6 or 7. </div></blockquote><br class="">As already written, there is no timeframe/deadline for this idea, it is just an idea,&nbsp;</div><div>not a proposal (yet).</div><div><div><br class=""><blockquote type="cite" class="">Let's postpone discussion until then.<br class=""></blockquote><div class=""><br class=""></div></div></div><div>Feel free to do so, but why postponing having ideas and discussing them?&nbsp;</div><div>In this case for instance, thinking about dynamic facilities, will presumably&nbsp;</div><div>also influence thinking about reflection and vice versa.&nbsp;</div><div>Thinking “wider” and “further” broadens the horizon of course.</div><div>For example. what about a compiler/interpreter self improving based on artificial intelligence? is this 2016?&nbsp;</div><div>So one can (should) do both: that is think in small steps, like discussing</div><div>“just” &nbsp;language elements and at the same time have an eye (or two) for the&nbsp;</div><div>broader picture. If one concentrates too much on the direct path in front, one might</div><div>not see other paths or what lays further ahead, which limits progress.&nbsp;</div><div><br class=""></div><div>————————————————</div><div>Let me write a small cartoon here, just intended as a little&nbsp;bit of humour just to illustrate this:</div><div><br class=""></div><div>A few thousand years ago, two very nice beings ( just returned from attending a</div><div>very primitive and awkward election debate, still shivering), &nbsp;looking at a pair&nbsp;</div><div>of fairly round stone slabs with a hole in the centre.</div><div><br class=""></div><div>“What’s this ?, Why round? why the holes? Nice job, but what is it? Is it art?”</div><div><br class=""></div><div>“Errrrhmm, well.. I might call it ‘Wheelz', not sure yet, you can use two of more of them</div><div>underneath or aside of things you’d like to move around more easily…</div><div>with less friction, which was a hell of a drag anyway."</div><div><br class=""></div><div>The other guy walks around it, apparently deeply thinking about it.&nbsp;</div><div>after some silence he says:</div><div>“Aha… hmm.. well.. Oh, i see, yeah, yep, that’s kinda cool.. might be useful.&nbsp;</div><div>But let’’s postpone discussing it until &nbsp;ball-bearings have been invented. “</div><div>————————————————</div><div><br class=""></div><div>hmmm, I really have too much time… :o)</div><div><br class=""></div><div>Kind Regards</div><div>Ted</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div>&nbsp;</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""><br class=""><blockquote type="cite" class=""><div class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Oct 11, 2016 at 15:59 David Sweeris via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">On Oct 11, 2016, at 12:40, Anton Zhilin via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="m_-1272261771439787227markdown-here-wrapper gmail_msg"><p style="margin:0px 0px 1.2em!important" class="gmail_msg">Hello Ted,<br class="gmail_msg">First of all, this topic belongs to reflection, which is specifically stated to be out of scope of Swift 4 Phase 1. So all considerations are purely theoretical for now.<br class="gmail_msg">That said, I also thought about this problem. The best I could imagine is something along the following lines:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class="gmail_msg"><code class="gmail_msg m_-1272261771439787227language-swift m_-1272261771439787227hljs" 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);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="m_-1272261771439787227hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">var</span> builder = <span class="m_-1272261771439787227hljs-type gmail_msg" style="color:rgb(68,85,136);font-weight:bold">StructBuilder</span>(name: <span class="gmail_msg m_-1272261771439787227hljs-string" style="color:rgb(221,17,68)">"Person"</span>)
builder.addProperty(name: <span class="gmail_msg m_-1272261771439787227hljs-string" style="color:rgb(221,17,68)">"name"</span>, type: <span class="m_-1272261771439787227hljs-type gmail_msg" style="color:rgb(68,85,136);font-weight:bold">String</span>.<span class="m_-1272261771439787227hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">self</span>)
builder.addProperty(name: <span class="gmail_msg m_-1272261771439787227hljs-string" style="color:rgb(221,17,68)">"age"</span>, type: <span class="m_-1272261771439787227hljs-type gmail_msg" style="color:rgb(68,85,136);font-weight:bold">Int</span>.<span class="m_-1272261771439787227hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">self</span>)
builder.addComputedProperty(name: <span class="gmail_msg m_-1272261771439787227hljs-string" style="color:rgb(221,17,68)">"description"</span>, getter: { (this: <span class="m_-1272261771439787227hljs-type gmail_msg" style="color:rgb(68,85,136);font-weight:bold">Any</span>) -&gt; <span class="m_-1272261771439787227hljs-type gmail_msg" style="color:rgb(68,85,136);font-weight:bold">String</span> <span class="m_-1272261771439787227hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">in</span> ... })
builder.addComformance(<span class="m_-1272261771439787227hljs-type gmail_msg" style="color:rgb(68,85,136);font-weight:bold">CustomStringConvertible</span>.<span class="m_-1272261771439787227hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">self</span>)
<span class="m_-1272261771439787227hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">let</span> type: <span class="m_-1272261771439787227hljs-type gmail_msg" style="color:rgb(68,85,136);font-weight:bold">Any</span>.<span class="m_-1272261771439787227hljs-type gmail_msg" style="color:rgb(68,85,136);font-weight:bold">Type</span> = builder.build()
</code></pre><p style="margin:0px 0px 1.2em!important" class="gmail_msg">Obviously, to interact with such dynamic types and their objects, we need the whole working reflection system that we don’t have right now.</p></div></div></blockquote></div><div dir="auto" class="gmail_msg">I *think* that's only true for non-generic code, and types that aren't subclasses... I think...<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Anyway, I'm starting to wonder if some code I'm trying to write might be impossible without either this feature, or some/all of the stuff from the generics manifesto. So put me down as, in principle, a strong +1 (pending details of the proposal when it actually gets written for Swift 10).</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">- Dave Sweeris&nbsp;</div></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>
</div></blockquote></div><br class=""></body></html>