Loop through all modules and module members?

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Jan 1 09:56:20 PST 2011


*the* J switch.

On 1/1/11, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> On 1/1/11, Philippe Sigaud <philippe.sigaud at gmail.com> wrote:
>> I'm not sure it's doable at
>> compile-time right now: you need to have access to the module code, as
>> text. Do imports work in CT-evaluable functions?
>>
>> Philippe
>>
>
> You're gonna love this:
>
> module mymodule;
>
> void main()
> {
>     pragma(msg, import(.stringof[7..$] ~ ".d"));
> }
>
> Of course, you need to -J switch with the path of your module.
>


More information about the Digitalmars-d-learn mailing list