<div dir="ltr">thanks.<div>That's a bit clunky though, so it's unlikely to be used. Not sure what it would take to make the grammar allow it.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 17, 2013 at 4:23 PM, bearophile <span dir="ltr"><<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Timothee Cour:<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there a way to achieve this:<br>
<br>
----<br>
module foo;<br>
<br>
{<br>
import bar;<br>
void fun1(){bar.barfun();}<br>
void fun2(bar.BarType a){}<br>
}<br>
<br>
// now bar is not in scope anymore.<br>
</blockquote>
<br></div>
Using a struct as namespace:<br>
<br>
<br>
struct Foo {<br>
    import std.stdio;<br>
    static void bar(int x) { x.writeln; }<br>
}<br>
alias bar = Foo.bar;<br>
<br>
void main() {<br>
    bar(10);<br>
    // writeln(20); // std.stdio out of scope<br>
}<br>
<br>
<br>
Bye,<br>
bearophile<br>
</blockquote></div><br></div>