DIP22 : Private symbol visibility

Dicebot m.strashun at gmail.com
Mon Jan 28 09:44:32 PST 2013


On Monday, 28 January 2013 at 17:36:58 UTC, Timon Gehr wrote:

> Fixing private is enough.
>
> Not a fan of the static thing at all. It is a great thing that 
> the static attribute actually has a consistent meaning in D.
>
> mixin template X(){
>     static int x = 2;
> }
>
> class C{
>     mixin X; // x is a public TLS variable
> }
>
> mixin X; // x is a public TLS variable.
>
> No need to screw this up.

Good, that was exactly example I could not crystallize. I wanted 
to avoid introduction of new keyword, thus reused static. May be 
there is no such way around.

Anyway, I intentionally kept static and private parts decoupled 
so either of them can be approved alone.


More information about the Digitalmars-d-announce mailing list