Newbie initial comments on D language - RTTI and run-time reflection

Bjoern nanali at nospam-wanadoo.fr
Tue Jan 29 00:11:04 PST 2008


Edward Diener schrieb:
> I have searched through the pdf documentation bit did not find a full
> explanation of RTTI facilities in D. The reason I ask about this is that
> it appears there is a 3rd party reflection facility but I do not see the
> documentation in D that explains if and how reflection works in D. Does
> it exist in D ? Is there documentation for it ?
> 

Here is a simple way of adding __traits based runtime reflection to D 
classes:

http://mainia.de/classinfoex.d
(requires DMD 2.004, by Jascha W.)

which is in fact compile-time to run-time reflection....
IMO the advantage of using this kind of runtime reflection is that you 
decide where runtime reflection is needed. (without producing too much 
bloat)
Well it requires D2 but Walter seems to be optimistic that we'll have a 
stable D2 at the end of the year.
Bjoern



More information about the Digitalmars-d mailing list