Agreed. The explicit and selective rtti would be great. Sometimes i need to create classes instead of structs because the reference semantics is more applicable, but i don't want to carry around type information, that I'm not gonna use.
On Thu, Oct 20, 2011 at 6:20 PM, Steven Schveighoffer <schvei...@yahoo.com> wrote: > On Thu, 20 Oct 2011 10:07:12 -0400, Gor Gyolchanyan > <gor.f.gyolchan...@gmail.com> wrote: > >>> D's runtime type info is very limited, so you may not be able to get what >>> you are looking for. >> >> D's compile-time type info is very rich and it's easy to remember it >> for run-time use. > > Yes, but you have to do some funky stuff to link it to the typeinfo. > Compare this to other languages where the compiler generates a very rich > set of runtime info (e.g. Java). > > I think actually, the runtime info generated by the compiler is seldom used > (except for maybe dynamic casting), and just creates bloat. > > I envision in the future, the runtime info generated would be triggered by > an annotation like @rtti("functions", "fields", "inheritance"). That would > give us a good hook to selectively generate rtti when it makes sense. > > -Steve >