Need reflection facilities

Dave Woldrich dave at woldrich.com
Wed Jan 3 13:05:58 PST 2007


Hello all, I read on the realtime type information how-to page that there are
some runtime type information facilities in D.
(http://www.prowiki.org/wiki4d/wiki.cgi?action=browse&id=HowTo/RealtimeTypeInformation)

I am the author of CeeFIT (http://ceefit.woldrich.com), the C++ implementation
of the Framework for Integrated Test (http://fit.c2.com).  It was extremely
painful to implement portable reflection capabilities into C++ to mimic what
goes on in Java.  Basically I used every function pointer, template, macro,
and static linker trick I knew to pull it off (and it's still fugly.)

If I were to implement fit for D (DeeFIT?) it would be extremely helpful to
have Class.forName() functionality out of the box as well as the ability to
get pointers-to-function and references to fields by name as well for a given
object.

Would it be possible for the D compiler to generate some table of symbols or
synthetically generated reflection module and provide that for linkage into
the final binary?  Maybe the compiler could employ the same sorts template
specialization and static initialization techniques I used in CeeFIT to
generate such artifacts.  Clearly such a table could double the size of the
resulting .exe, but not like I care.

Cheers,
Dave Woldrich



More information about the Digitalmars-d mailing list