imports in functions
Brad Roberts
braddr at puremagic.com
Mon Jun 13 20:51:24 PDT 2011
On 6/13/2011 8:48 PM, Andrej Mitrovic wrote:
> I'm guessing this is what you're after:
>
> http://codepad.org/TCtG68Fw
> http://codepad.org/65GBDjPS
>
> rdmd main.d
> shared ctor!
> ctor!
> foo.test
> dtor!
> shared dtor!
Actually, not what I was thinking. I was thinking something like this:
file 1:
import std.stdio; // or inside this, not what I'm testing.
static this()
{
writeln("foo");
}
file 2:
void main()
{
import file1;
}
More information about the Digitalmars-d
mailing list