Enhancement request
Sjoerd van Leent
svanleent at gmail.com
Thu Jul 9 23:49:35 PDT 2009
grauzone Wrote:
> The problem is, that you have to litter your code with calls like above.
Exactly. Even though it can just be brought down to one additional statement per class, the statement in itself doesn't create any functionality, at least, from programmers perspective.
This could obviously be done by a pre-compiler, but that's going to Qt way, which I don't really prefer doing, and includes the need for a complete D frontend, just to pull a few switches.
> Even with D2's glorious __traits, this problem persist: you have to pass
> all types manually to some piece of compile time code.
>
> Now, dear D Gods, how are we supposed to solve this problem? Could we
> (at least) get a way to list all members of a module with __traits?
It would, in cases that you want to have a fully reflective module (that is, being able to completely know how a module works at runtime), solve a good number of issues.
> (Wow, a function crawling all modules recursively at compile time sure
> would produce a lot of template bloat.)
I think these things are allways bloated, but at times, this is less horrible than unreadable code that doesn't have any logic except from being able to map certain things around.
It would also help providing a nice interface for RPC and the like. I still have ugly memories about MSIDL and the C++ code coming from it. It's hellish, to say the least.
More information about the Digitalmars-d
mailing list