On Wed, Jul 18, 2012 at 2:59 PM, Jacob Carlborg <d...@me.com> wrote: > On 2012-07-18 06:10, lijie wrote: > > Free functions support is hard, with runtime cast, I just think compile >> time. >> > > 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. > > http://flectioned.kuehne.cn/
It is an optional way. I want to do all thing in D code. > > > I am trying to support free functions at compile time, is also hard, >> since the generator in gointerface module, but other modules are only >> visible in the module that used these modules. I have an ugly >> implementation used compile time string mixin, trying to simplify it. >> Fighting. >> > > 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). I didn't know this usage, I will try it. Thanks.