Understanding import

jicman jicman_member at pathlink.com
Thu Mar 2 12:41:39 PST 2006


Understanding import...

so I have this module:

// my module DAE.d
module DAE;
class Class0
{
..
}
class Class1
{
..
}
class Class2
{
..
}
class Class3
{
..
}
class Class4
{
..
}
class Class5
{
..
}

and this program

// test.d
private import DAE;

int main(char[][] args)
{
Class1 ini = new Class1();
ini.blah = 1;
writefln(ini.blah);
return(1);
}

When test.d is compiled, though I only used the Class1 instance and not any
others, will the executable be bloaded by the extra ClassX, or would compiler
know not to include the rest of the ClassX instances?  What I am trying to
figure out is if I should declare some of these classes in the main programs
which use these other classes instead of the libraries.

Any ideas?

thanks.

josé





More information about the Digitalmars-d-learn mailing list