Why can't we put import in functions.
Bruno Medeiros
brunodomedeiros+spam at com.gmail
Thu Oct 18 12:26:09 PDT 2007
Robert Fraser wrote:
> Yang Bo Wrote:
>
>> We can put "using namesapce" in any place in C++. Why not do the same
>> way in D?
>
> mixin(import(FILENAME));
>
> You may need a compile-time function to strip the module declaration and be wary of forward references.
That doesn't work: any (non-instance) variable definition of the
imported module would be duplicated.
--
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d
mailing list