Why the compiler dosen't enforce correct module declarations?

Sean Kelly sean at f4.ca
Tue May 22 08:12:25 PDT 2007


Ary Manzana wrote:
> 
> Shouldn't the compiler say "Wait, you are saying that module one is in 
> file main.d, module two is in other.d and module lala.la is in 
> dir/some_other.d, this isn't quite well"?

I've decided that this is actually a good thing.  It allows large 
modules to be split across multiple files and for different 
implementation files to be chosen at compile time when using the 
header/source model.  It's also the only way I've found to compile the 
implementation of "object.d" for Tango.  Actually naming it "object.d" 
caused all sorts of problems.


Sean


More information about the Digitalmars-d-learn mailing list