On Wed, Jul 18, 2012 at 2:59 PM, Jacob Carlborg <span dir="ltr"><<a href="mailto:doob@me.com" target="_blank">doob@me.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 2012-07-18 06:10, lijie wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Free functions support is hard, with runtime cast, I just think compile<br>
time.<br>
</blockquote>
<br></div>
It's possibly to implement runtime reflection by loading the running executable and inspecting the symbol table. It's an ugly hack but it should work.<br>
<br>
<a href="http://flectioned.kuehne.cn/" target="_blank">http://flectioned.kuehne.cn/</a></blockquote><div><br></div><div>It is an optional way. I want to do all thing in D code.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am trying to support free functions at compile time, is also hard,<br>
since the generator in gointerface module, but other modules are only<br>
visible in the module that used these modules. I have an ugly<br>
implementation used compile time string mixin, trying to simplify it.<br>
Fighting.<br>
</blockquote>
<br></div>
I think you can pass a module to a template via an alias parameter. Then the template should be able to inspect all free functions using something like __traits(allMembers).</blockquote><div><br></div><div>I didn't know this usage, I will try it. Thanks.</div>
</div><br>