Need runtime reflection?

Jacob Carlborg doob at me.com
Tue Jul 17 23:59:21 PDT 2012


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/

> 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).

-- 
/Jacob Carlborg




More information about the Digitalmars-d mailing list