separate and/or independent compilation
Myron Alexander
someone at somewhere.com
Thu Jun 7 17:19:03 PDT 2007
Jarrett Billingsley wrote:
> "Myron Alexander" <someone at somewhere.com> wrote in message
> news:f49mt6$1t6d$1 at digitalmars.com...
>> In D, the import statement imports a compiled module, not source.
>>
>> ...
>>
>> In one sentence, modules provide the functionality of #include (and so
>> much more) but with "special" binaries rather than source.
>
> Not exactly. When you import a module, it will only ever look for a source
> file (.d or .di). It never looks for compiled modules. Once it finds a
> source file, it will lex it, parse it, and do enough semantic analysis to
> extract the symbol table, which can then be used from the current module.
>
>
Thanks for the clarification, I misunderstood how modules work.
Please correct me if the following is incorrect:
Modules are not included in the current source as part of the source
(like #include does) but the module (.d) or module interface (.di) is
parsed for declarations and module constructor/destructor/static methods.
Thanks,
Myron.
More information about the Digitalmars-d-learn
mailing list