Nested public imports - bug or feature?

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 13 08:40:11 PDT 2015


On 08/13/2015 05:29 PM, Dicebot wrote:
> On Thursday, 13 August 2015 at 13:44:50 UTC, rsw0x wrote:
>> And we're back to namespaces : )
>
> Not really.
>
> This is namespace:
>
> -----
> module a;
>
> struct Something
> {
>    static void foo() {}
> }
>
> module b;
>
> import a;
>
> void main() { Something.foo(); }
> -----
>
> This is import hygiene:
>
> -----
> module a;
>
> void foo() { }
>
> module b;
>
> struct Something
> {
>      public import a;
> }
>
> void main() { Something.foo(); }
> -----
>
> Without that you risk breaking the code each time you add new symbol to
> a library -

You know about static imports, right?

> D module system is completely broken in that regard.

What's the alternative?


More information about the Digitalmars-d mailing list