The future of UDAs.

David Nadlinger see at klickverbot.at
Tue Nov 27 08:59:34 PST 2012


On Tuesday, 27 November 2012 at 15:49:45 UTC, Gor Gyolchanyan 
wrote:
> Can you implement this use case?
> Have classes mix in something,, which will register them in a 
> single place,
> which can later suppl the registered classes as a type tuple.

This is fundamentally impossible in the D module system if the 
"single place" S does not import the modules where the types are 
defined. Even if you could append strings to a "compile-time 
global" in S, this still wouldn't help you in any way because if 
you tried to mix in the string in S, you'd get nothing but a slew 
of undefined symbol errors.

Maybe you can describe your use case a bit? I'm optimistic that 
there is a solution which is not radically incompatible with the 
design of D.

David


More information about the Digitalmars-d mailing list