Timothee Cour:

Is there a way to achieve this:

----
module foo;

{
import bar;
void fun1(){bar.barfun();}
void fun2(bar.BarType a){}
}

// now bar is not in scope anymore.

Using a struct as namespace:


struct Foo {
    import std.stdio;
    static void bar(int x) { x.writeln; }
}
alias bar = Foo.bar;

void main() {
    bar(10);
    // writeln(20); // std.stdio out of scope
}


Bye,
bearophile

Reply via email to