I can't recall the exact use case which drove me to this topic at the moment. I'll definitely post it as soon as I remember. D's CTFE, mixins and templates almost make up a full language for compile-time. This allows generating the source code from within source code. The problem is that it's impossible to perform compile-time actions on a combination of modules in different compiler runs. different directly unrelated modules could contribute to the code generation process if mutable compile-time variables were available.


On Tue, Nov 27, 2012 at 8:59 PM, David Nadlinger <see@klickverbot.at> wrote:
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



--
Bye,
Gor Gyolchanyan.