Reflection?

bearophile bearophileHUGS at lycos.com
Tue Oct 26 14:25:18 PDT 2010


Andrei:

> Rory McGuire:
> > To get some basic runtime reflection one could use dmd's json dump.
> >
> > and then use import("filename.json") to get the json into the
> > executable. Then make a class which makes it more usable as a
> > reflection system.
> >
> > You can try it out by compiling this code twice, first time with a
> > dummy jsontest.json.
> 
> That's a very interesting idea.

I have recently suggested a:
__traits(json, moduleName)

to be used with CTFE that process the resulting JSON tree data (represented with tagged unions, etc). It's a little step forward for static introspection in D. But at best it's not a fast/efficient thing.

Bye,
bearophile


More information about the Digitalmars-d mailing list